database.sql library

Supports accessing databases using SQL language.

Example

// Configure database
final database = MyDatabaseAdapter().database();

// Get SQL client. Currently only SQL databases support this.
final sqlClient = database.sqlClient;

// Read matching rows
final products = sqlClient.query(
  'SELECT * FROM employee WHERE role = ?',
  ['software developer],
).toMapStream();

// Iterate the stream
await for (var product in products) {
  print('Name: ${product['name']}');
}

Classes

SqlClient
SQL client for accessing a Database. [...]
SqlClientBase
Superclass of both SqlClient and SqlTransaction.
SqlClientTableHelper
A helper class used by SqlClient for building statements/queries. [...]
SqlClientTableQueryHelper
A helper class used by SqlClient for building statements/queries. [...]
SqlClientTableSelectionHelper
A helper class used by SqlClient for building statements/queries. [...]
SqlColumnDescription
Identifies an SQL column.
SqlColumnEntry
SqlIterator
A row iterator obtained from SqlClient. [...]
SqlSourceBuilder
Builds instances of SqlStatement.
SqlStatement
SQL source string and arguments. [...]
SqlStatementResult
A non-query statement result obtained from SqlClient. [...]
SqlTransaction
A transaction obtained from SqlClient. [...]
SqlType
Identifies an SQL type such as LONG INT or VARCHAR(160).

Enums

SqlReferenceDeleteAction
SqlReferenceUpdateAction