easy_mssql_windows 0.0.2
easy_mssql_windows: ^0.0.2 copied to clipboard
A Easy Flutter Package for connected to MS SQL Server.
Easy MSSQL Windows #
A Flutter package designed to simplify connecting a Flutter desktop application on Windows to a Microsoft SQL Server database using ODBC. It provides straightforward methods for establishing a connection, executing queries, and managing the disconnection process.
📋 Overview #
easy_mssql_windows abstracts the complexities of FFI (Foreign Function Interface) calls to the Windows ODBC (Open Database Connectivity) API, allowing developers to interact with MS SQL Server databases with minimal setup. This package is specifically tailored for Windows desktop applications.
Key Features:
- Easy-to-use API for connecting to MS SQL Server.
- Simple methods for executing SQL queries.
- Proper management of ODBC handles and disconnection.
- Designed for Flutter applications running on the Windows platform.
⚠️ Prerequisites #
Before using this package, please ensure the following prerequisites are met on the target Windows system:
- Windows Operating System: This package is specifically designed for and tested on Windows.
- ODBC Driver for SQL Server: ODBC Driver 17 for SQL Server (or a compatible newer version like ODBC Driver 18) must be installed on the system. You can download the official Microsoft ODBC drivers from their website.
- Network Access: The Windows machine running the application must have network access to the target MS SQL Server instance.
💻 Installation #
-
Add
easy_mssql_windowsto yourpubspec.yamlfile:dependencies: flutter: sdk: flutter easy_mssql_windows: ^[your_package_version] # Replace with the latest versionIf you are using a local path during development:
dependencies: flutter: sdk: flutter easy_mssql_windows: path: ../path_to_your_package -
Run
flutter pub getin your terminal from your project's root directory. -
Import the package in your Dart code:
import 'package:easy_mssql_windows/easy_mssql_windows.dart';
🚀 Usage #
Here's a basic guide on how to use the easy_mssql_windows package:
1. Initialize the Connector #
First, create an instance of OdbcConnector. It's recommended to manage its lifecycle within a StatefulWidget if your connection is tied to a specific screen or part of your application.
final OdbcConnector odbcConnector = OdbcConnector();
// Optional: If your odbc32.dll is not in a standard system path,
// or if you are using a different ODBC driver manager DLL, you can specify its name:
// final OdbcConnector odbcConnector = OdbcConnector(odbcLibName: 'custom_odbc_driver_manager.dll');