dart_odbc 1.0.2+1
dart_odbc: ^1.0.2+1 copied to clipboard
A Dart package for interacting with ODBC databases. It allows you to connect to ODBC data sources and execute SQL queries directly from your Dart applications.
dart_odbc #
This is an api library for communicating with the odbc driver from dart This package is inspired by the original odbc (obsolete).
This package is still in its early development stage and is not recommended for production #
Usage #
- Instanciate the ODBC class by providing the path to the odbc driver on the host machine
final odbc = DartOdbc('/path/to/the/odbc/driver');
- Connect to the database by providing the DSN (Data Source Name) configured in the ODBC Driver Manager
odbc.connect(
dsn: '<your_dsn>',
username: 'db_username',
password: 'db_password',
);
- In case the path privided to the driver is invalid or there is any issue with setting up the environment/connecting to the database, an
Exceptionwill be thrown when intanciating the ODBC or connecting to the database. - Execute your queries directly as follows
final result = odbc.execute("SELECT 10");
- Result will be a
ListofMapobjects where each Map represents a row. If anything goes wrong anExceptionwill be thrown
Accessing low level API #
-
Since this package is at its early stage, most advanced functionalities are not implemented or tested yet. In case you need more functionality, the direct access to the
ODBCdriver can be obtained by importing theSQLclass. -
For more information on the
ODBCapi go to Microsoft ODBC Documentation
TODO:
- ❌ Implement query sanitization