dart_mssql 0.2.0

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 82

dart_mssql #

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

Important #

  • 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.


Compile 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

[0.0.1] - Initial Release

  • Microsoft SQL Server Driver for Dart (32 & 64bits) initial release.

example/main.dart

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();
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dart_mssql: ^0.2.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dart_mssql/dart_mssql.dart';
  
Version Uploaded Documentation Archive
0.2.0 Mar 24, 2019 Go to the documentation of dart_mssql 0.2.0 Download dart_mssql 0.2.0 archive
0.1.0+8 Mar 9, 2019 Go to the documentation of dart_mssql 0.1.0+8 Download dart_mssql 0.1.0+8 archive
0.1.0+7 Feb 22, 2019 Go to the documentation of dart_mssql 0.1.0+7 Download dart_mssql 0.1.0+7 archive
0.1.0+6 Feb 22, 2019 Go to the documentation of dart_mssql 0.1.0+6 Download dart_mssql 0.1.0+6 archive
0.1.0+5 Feb 15, 2019 Go to the documentation of dart_mssql 0.1.0+5 Download dart_mssql 0.1.0+5 archive
0.1.0+4 Feb 12, 2019 Go to the documentation of dart_mssql 0.1.0+4 Download dart_mssql 0.1.0+4 archive
0.1.0+3 Feb 12, 2019 Go to the documentation of dart_mssql 0.1.0+3 Download dart_mssql 0.1.0+3 archive
0.1.0+2 Feb 10, 2019 Go to the documentation of dart_mssql 0.1.0+2 Download dart_mssql 0.1.0+2 archive
0.1.0+1 Feb 8, 2019 Go to the documentation of dart_mssql 0.1.0+1 Download dart_mssql 0.1.0+1 archive
0.1.0 Feb 8, 2019 Go to the documentation of dart_mssql 0.1.0 Download dart_mssql 0.1.0 archive

All 16 versions...

Popularity:
Describes how popular the package is relative to other packages. [more]
64
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
82
Learn more about scoring.

We analyzed this package on Apr 12, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.2.0
  • pana: 0.12.14

Platforms

Detected platforms: other

Primary library: package:dart_mssql/dart_mssql.dart with components: nativewrappers.

Health suggestions

Fix lib/src/sql_connection.dart. (-0.50 points)

Analysis of lib/src/sql_connection.dart reported 1 hint:

line 31 col 41: Use = to separate a named parameter from its default value.

Format lib/dart_mssql.dart.

Run dartfmt to format lib/dart_mssql.dart.

Format lib/recase.dart.

Run dartfmt to format lib/recase.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
collection ^1.14.11 1.14.11
meta ^1.1.7 1.1.7
quiver >=2.0.0 <3.0.0 2.0.3
recase ^2.0.1 2.0.1
Transitive dependencies
matcher 0.12.5
path 1.6.2
stack_trace 1.9.3
Dev dependencies
pedantic ^1.0.0