
Open source
SQL Connection
- Flutter
- Dart
- SQL Server
- Android
Project overview
A Flutter plugin that connects Android apps to SQL Server, supports database queries and provides explicit connection management.
what went into it
- 01
Exposes SQL Server connection and query operations to Flutter on Android.
- 02
Supports reading results and insert, update and delete operations.
- 03
Provides configurable connection parameters, timeouts and explicit disconnect support.
build log
How I built it.
The problem
Flutter has no first-party way to talk to SQL Server from Android, and plenty of internal business tools still live on it. I wanted a plugin that makes that a handful of calls, not a custom backend.
Architecture
- Platform channel
- A MethodChannel bridges Dart to the Android side, which owns the actual JDBC connection. Dart only ever sees plain maps and lists.
- Explicit lifecycle
- Connect and disconnect are separate calls with configurable timeouts. Hiding the connection behind a singleton would have been easier, but leaks sockets on hot restart.
- Typed results
- Query results come back as rows keyed by column name, and writes (insert, update, delete) share one execute path so error handling lives in one place.
- Packaging
- Published on pub.dev with a minimal example app, so a new user can copy a working connection string and run it.
What I’d change
- Offer prepared statements so callers stop building SQL by string concatenation.
- Run queries off the main thread by default and expose a cancel call.
- Add iOS or a desktop path; right now it is Android only, and I say so in the README.


