将SQL Server与Dart一起使用 [英] Using SQL Server with Dart

查看:110
本文介绍了将SQL Server与Dart一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有找到一个很好的答案,所以我想尝试获得答案.将Microsoft SQL Server与Dart一起使用的最佳方法是什么?我需要它能够从基本上任何OS Web和Mobile上使用它.我觉得最好的方法可能是GraphQL,但是我没有经验.我已经看到很多东西在说.NET API,但是我不确定如何在Dart中使用.NET API.预先谢谢你.

I haven't found a great answer this so I wanted to try my hand at getting an answer. What is the best way to use Microsoft SQL Server with Dart? I need it to be able to use it from essentially any OS Web and Mobile. I feel the best way may be GraphQL but I am unexperienced in it. I have seen plenty of things saying a .NET API but I am unsure as to how to use the .NET API with Dart. Thank you in advance.

推荐答案

最佳方法" :没有解决方案,您必须决定要使用的框架和工具.但是,我将举一个简单的示例,说明客户端应用程序通常如何连接到数据库.最基本的示例:

"The best way": there is no silverbullet, you'll have to decide what frameworks and tools to use. But i'll give a simple example how a client application typically connects to a database. Most basic example:

客户端应用程序可以是用户通常使用的任何应用程序.一些例子:

The client application can be any application the user typically uses. Some examples:

  • 移动应用(以本机,Dart,Xamarin等语言编写)
  • 台式机应用程序(电子,WPF等)
  • 网站应用(Angular,React,Vue等)
  • ...

那里有API来检索数据和更改数据.但是它还将处理身份验证,授权,日志记录,业务逻辑,...

The API is there to retrieve data, and change data. But It will also handle authentication, authorization, logging, doing business logic, ...

API可以是您想要的任何技术.在您的示例.net核心中.重要的是您的客户端应用程序可以与您的api通信.使用GraphQL,REST(JSON,XML,...),...

The API can be any technology you want. In your example .net core. Whats important is that your client application can communicate with your api. Using GraphQL, REST (JSON, XML, ...), ...

Dart具有用于 GraphQL

Dart has packages for GraphQL and REST

您的API随后将在您选择的数据库上执行查询,插入,更新,删除,执行存储过程.在您的示例SQL Server中.

Your API will then execute queries, inserts, updates, deletes, execute stored procedures on the Database of your choice. In your example SQL Server.

根据您的技能,框架知识以及部署方式,有很多设置方法.

您要如何部署它也会限制您的选择.对于您的API:

How you want to deploy this will limit your choices as well. For your API:

  • 无服务器API(通过Azure函数,AWS Lambda等)
  • 云网站(Azure Web应用程序,...)
  • 在本地托管的网站
  • Docker容器
  • ...

在现实生活中,防火墙,应用程序网关,虚拟网络,群集等通常会使情况变得更加复杂.

In real life scenarios this often gets more complex with Firewalls, Application Gateways, Virtual networks, clusters, ...

这篇关于将SQL Server与Dart一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆