knex_dart_mssql 0.1.0
knex_dart_mssql: ^0.1.0 copied to clipboard
Microsoft SQL Server driver for knex_dart — execute queries against SQL Server via the mssql_connection FFI package (FreeTDS).
knex_dart_mssql #
Microsoft SQL Server driver for knex_dart using the mssql_connection FreeTDS-based runtime.
Installation #
dependencies:
knex_dart_mssql: ^0.1.0
Quick Start #
import 'package:knex_dart_mssql/knex_dart_mssql.dart';
final db = await KnexMssql.connect(
host: 'localhost',
database: 'AdventureWorks',
username: 'sa',
password: 's3cr3t!',
);
final rows = await db.select(
db
.queryBuilder()
.table('users')
.where('active', '=', 1)
.orderBy('id')
.limit(10),
);
await db.close();
Platform Requirements #
- Native runtime only (uses FFI through
mssql_connection). - FreeTDS installation is required:
- macOS:
brew install freetds - Ubuntu/Debian:
sudo apt-get install -y freetds-dev libct4
- macOS:
Dialect Capabilities #
knex_dart_capabilities does not currently include a dedicated mssql dialect entry, so static capability checks are not available yet for SQL Server.
Implemented driver/compiler highlights:
- MSSQL
OFFSET ... FETCH NEXT ...pagination compilation for.limit()/.offset(). having(...)andhavingRaw(...)compilation.- Window-function SQL generation from query builder methods.
Known Limitations #
- No connection pooling in this driver (single shared connection runtime).
- Underlying
MssqlConnectionis singleton-based; operations are effectively serialized. - SQL Server-specific bracket quoting (
[col]) is not emitted by default query compiler; useraw()when exact bracketed SQL is needed. - Alias aggregate expressions (for example
count(*) as total) so result keys are predictable.