搜索插件、代码仓与 APP 分类

插件详情v1.0.1

dart_mssql

适用于 Dart 的高性能 Microsoft SQL Server 驱动程序(32 位和 64 位)

近 30 天下载
126
喜欢数
32
Pub 分数
40

安装插件

flutter pub add dart_mssql

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

dart_mssql 是一个高性能的 Microsoft SQL Server 驱动程序,适用于 Dart,支持 32 位和 64 位系统。它为需要与 SQL Server 数据库进行强大交互的 Dart 应用程序提供无缝数据库连接。该驱动程序设计高效且可靠,可在服务器端或桌面环境中实现安全快速的数据操作。通过简单的 API 使用,该包可与 Flutter 及其他 Dart 项目无缝集成。其开源性质允许社区贡献并保持透明度。非常适合依赖 SQL Server 作为后端的开发者构建应用程序。

适合场景

  • 将 Flutter 应用连接到 SQL Server 数据库
  • 使用 SQL Server 集成构建后端服务
  • 在Dart中执行高速数据库查询
  • 将传统的 SQL Server 系统迁移至基于 Dart 的解决方案
  • 使用 SQL Server 访问开发跨平台桌面应用程序

主要特点

  • 支持32位和64位系统
  • 高性能数据库操作
  • 安全连接处理
  • 开源且由社区驱动
  • 用于 SQL 交互的简单直观的 API

适合对象

  • 针对 SQL Server 的 Dart 开发人员
  • 需要可靠数据库访问的后端服务
  • 需要从 SQL Server 快速检索数据的应用程序
  • 使用 Dart 的跨平台桌面应用程序开发者
  • 正在将团队迁移到 Dart 并拥有现有的 SQL Server 基础架构

使用建议

  • 仅限 SQL Server
  • 不支持移动平台的官方支持
  • 需要原生依赖项以实现完整功能
  • 可能需要特定于平台的构建
  • 不适用于非 SQL Server 数据库

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

dart_mssql

High Performance Microsoft SQL Server (MS-SQL Server) Driver for Dart (32 & 64bits)

Important

  • This package is not suitable for flutter or web projects. It only runs on server-side apps.
  • It works only on Windows (32bits or 64bits)
  • You have to install OLE DB Driver
  • You have to install Microsoft Visual C++ Redistributable
  • dart_mssql_32.dll (32-bit) and dart_mssql_64.dll (64-bit) are the compiled versions of the driver. Rename to "dart_mssql.dll" according to your needs and copy it to the main directory of your project.

Example Usage

Demo code to perform Raw SQL queries

import 'dart:io';
import 'package:dart_mssql/dart_mssql.dart';

void main() async {
  SqlConnection connection = SqlConnection(host:"SERVERNAME", db:"DBNAME", user:"USERNAME", password:"PASSWORD");
  String cmd = "select email from usuario where id_usuario=?";
  
  SqlResult result = connection.execute(cmd,[4]);
  result.rows.forEach((e) {
    print("${e.email}");
  });
  print("end of printing.");
  connection.close();
  stdin.readLineSync();
}

Troubleshooting

Problem:
The specified module could not be found.
error: library handler failed

Cause:
Missing installing Microsoft OLE DB Driver OR missing dart_mssql.dll file into project main directory OR missing Microsoft Visual C++ Redistributable

Solution:
Copy dart_mssql.dll file into project main directory.


Problem:
%1 is not a valid Win32 application.
error: library handler failed

Cause:
incorrect dart_mssql.dll version (32 bits with dart VM 64 bits or vice versa)

Solution:
Copy correct dart_mssql.dll file into project main directory.


Compiling with Microsoft Visual Studio 2017 Community Edition

IF AND ONLY IF you want to compile library source code (C++ part) follow the instructions below:

  • Before compile, you have to install Windows 10 SDK on your Microsoft Visual Studio 2017 Community Edition
  • Open solution file dart_mssql\cpp\dart_mssql.sln with Microsoft Visual Studio 2017 Community Edition
  • On "Solution Explorer" Panel right click on dart_mssql project and select "Rebuild"
  • Put the generated dart_mssql.dll file into your project main folder (same folder of your pubspec.yaml file)
  • Be sure to have correct dart-sdk\bin folder (32 or 64 bits) in VC++ Directories -> Library Directories. Change "F:\DartSDK64\dart-sdk\bin" to your location
  • Be sure to have correct dart.lib version (32 or 64 bits) in Linker -> Input -> Additional Dependencies. Change "F:\DartSDK64\dart-sdk\bin\dart.lib" to your location

所属分类

依赖

依赖清单 6 项

  • collection^1.14.11
  • meta^1.1.6
  • sql_recase^0.2.1
  • sql_result^0.2.2
  • sql_utils^0.2.0
  • string_utils^0.2.0

源码仓库

使用此插件的项目

暂无相关数据。