Search packages, repositories and app categories

Package detailsv1.0.1

dart_mssql

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

30-day downloads
126
Likes
32
Pub points
40

Install package

flutter pub add dart_mssql

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

dart_mssql is a high-performance Microsoft SQL Server driver for Dart, supporting both 32-bit and 64-bit systems. It enables seamless database connectivity for Dart applications requiring robust interaction with SQL Server databases. Designed for efficiency and reliability, it facilitates secure and fast data operations in server-side or desktop environments. The package integrates smoothly with Flutter and other Dart projects through simple API usage. Its open-source nature allows community contributions and transparency. Ideal for developers building applications that depend on SQL Server as their backend.

Use cases

  • Connecting Flutter apps to SQL Server databases
  • Building backend services with SQL Server integration
  • Performing high-speed database queries in Dart
  • Migrating legacy SQL Server systems to Dart-based solutions
  • Developing cross-platform desktop applications with SQL Server access

Key features

  • Supports 32-bit and 64-bit systems
  • High-performance database operations
  • Secure connection handling
  • Open-source and community-driven
  • Simple, intuitive API for SQL interactions

Suitable for

  • Dart developers targeting SQL Server
  • Backend services requiring reliable database access
  • Applications needing fast data retrieval from SQL Server
  • Cross-platform desktop app developers using Dart
  • Teams migrating to Dart with existing SQL Server infrastructure

Considerations

  • Limited to SQL Server only
  • No official support for mobile platforms
  • Requires native dependencies for full functionality
  • Platform-specific builds may be needed
  • Not suitable for non-SQL Server databases

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

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

Categories

Dependencies

Dependency list 6 items

  • 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

Source repository

Projects using this package

No data available yet.