搜尋套件、儲存庫與 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

原始碼儲存庫

使用此套件的專案

暫無相關資料。