dart_odbc 1.0.2+1 copy "dart_odbc: ^1.0.2+1" to clipboard
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).

style: very good analysis

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 Exception will 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 List of Map objects where each Map represents a row. If anything goes wrong an Exception will 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 ODBC driver can be obtained by importing the SQL class.

  • For more information on the ODBC api go to Microsoft ODBC Documentation

TODO:

  • ❌ Implement query sanitization
16
likes
0
pub points
73%
popularity

Publisher

verified publisherslpirate.dev

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.

Repository (GitHub)
View/report issues

Topics

#db #database #odbc #sqlserver #oracle

License

unknown (license)

Dependencies

ffi

More

Packages that depend on dart_odbc