mssql_connection 3.1.0 copy "mssql_connection: ^3.1.0" to clipboard
mssql_connection: ^3.1.0 copied to clipboard

Flutter/Dart plugin to connect to Microsoft SQL Server using Dart FFI + FreeTDS. Cross-platform: Windows, Android, iOS, macOS, Linux.

Changelog #

All notable changes to this project will be documented in this file.

3.1.0 #

Added #

  • connect() options: encrypt, trustServerCertificate, and tdsVersion for TLS/TDS control on hosted and local SQL Server.
  • Integration tests for connect options and RPC null/Unicode parameter bindings.
  • MssqlClient.executeBatch(): send multiple SQL statements in a single dbcmd/dbsqlexec round-trip instead of one round-trip per statement.
  • MssqlClient.executeParamsBatch(): batch multiple parameterized statements into chunked SQL batches with safely escaped literals, avoiding one sp_executesql RPC per statement.

Changed #

  • MssqlConnection.writeBatch() now sends all statements as a single network round-trip (wrapped in BEGIN TRAN/COMMIT) instead of executing each statement sequentially. ~15,000+ rows/sec for batched INSERTs (up from ~100 rows/sec doing one round-trip per row).
  • MssqlConnection.writeBatchWithParams() now uses executeParamsBatch internally, giving roughly an 80x throughput improvement over the previous one-RPC-per-statement implementation while preserving parameterized value safety (proper quoting/escaping, no string concatenation of user input).

Fixed #

  • Parameterized queries (getDataWithParams / writeDataWithParams) now bind NULL and Unicode strings using UTF-8 SYBVARCHAR, fixing connection drops on Azure SQL Edge (Msg 3621 / type 0x67).
  • DB-Lib error messages are appended instead of overwritten, improving diagnosability.
  • Large FOR JSON PATH payloads no longer truncate when FreeTDS returns BUF_FULL from dbnextrow().
  • macOS Homebrew library paths for Apple Silicon and Intel (/opt/homebrew/lib, /usr/local/lib).

3.0.0 #

Added #

  • Cross-platform support via Dart FFI + FreeTDS for Windows, Android, iOS, macOS, and Linux.
  • Transaction helpers: beginTransaction, commit, rollback.
  • Bulk insertion API using FreeTDS BCP for high-throughput inserts.
  • Parameterized queries (via sp_executesql) to reduce SQL injection risk.

Changed #

  • Unified JSON response shape for all operations: { "columns": [...], "rows": [...], "affected": N }.
  • Replaced platform-specific method channels/ODBC paths with a single FFI pipeline for consistent behavior.

Fixed #

  • More robust Unicode/large text handling and consistent Base64 encoding for binary columns.

Breaking #

  • getData/writeData return a unified JSON object instead of an array-only payload. Update parsers accordingly.

2.0.2 #

Changed #

  • Improved handling of affected row count for UPDATE statements returning 0 rows on Windows.
  • Enhanced type parsing in the default case for the Windows platform to support long text and binary fields.
  • Suppressed warnings related to jcifs and org.ietf.jgss classes during build.
  • Addressed R8 build issues, including missing classes and binary type resolution.
  • Fixed UTF-8 decoding inconsistencies when reading large text fields on Windows.

2.0.1 #

Updated #

  • Adjusted environment configuration for improved compatibility with a broader range of Flutter projects.

2.0.0 #

Added #

  • Gradle 8 support for improved compatibility with the latest Android tools.
  • Windows support using ODBC for seamless database connectivity on Windows platforms.

Updated #

  • Enhanced error handling with a custom exception mechanism for better debugging and user feedback.
  • Performance optimization and memory improvements.

Fixed #

  • Resolved issues with error message parsing to ensure consistent error details in logs.

1.1.3 #

Fixed #

  • Bug fixes related to the execution of stored procedures, improving reliability.

1.1.2 #

Updated #

  • Changed the bit SQL type handling to Integer for improved type compatibility and consistency.

1.1.1 #

Updated #

  • Modified the timestamp format from milliseconds to a date string for better readability and interoperability.

1.1.0 #

Optimized #

  • Plugin refactoring: Converted codebase from Java to Kotlin, resulting in significant performance enhancements and cleaner code structure.

1.0.3 #

Updated #

  • Improved code documentation for better developer understanding and usage guidelines.

1.0.2 #

Updated #

  • Enhanced project documentation to include detailed setup and usage instructions.

1.0.1 #

Added #

  • Initial release of the Flutter plugin for connecting to Microsoft SQL Server databases.
  • Support for customizable database connection parameters.
  • Functionality to execute SQL queries and retrieve results in JSON format.
  • Support for database write operations (insert, update, delete) with transaction management.
  • Automatic reconnection handling for robust connectivity during connection interruptions.
  • Configurable timeout settings for managing database connection response times.
34
likes
140
points
2.32k
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter/Dart plugin to connect to Microsoft SQL Server using Dart FFI + FreeTDS. Cross-platform: Windows, Android, iOS, macOS, Linux.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

ffi

More

Packages that depend on mssql_connection