sqlitenow_runtime 0.9.0 copy "sqlitenow_runtime: ^0.9.0" to clipboard
sqlitenow_runtime: ^0.9.0 copied to clipboard

Dart runtime contracts for SQLiteNow generated code.

sqlitenow_runtime #

Runtime contracts for SQLiteNow Dart generated code.

This package currently targets Dart VM and Flutter native runtimes through package:sqlite3. The SQLite driver is kept behind a small boundary so a web driver can be evaluated later without changing generated query APIs.

Install #

dependencies:
  sqlitenow_runtime: ^0.9.0

Use this package with generated Dart code from sqlitenow_cli.

Documentation:

Example #

final database = SqliteNowDatabase.inMemory(
  migrations: [
    SqliteNowMigrationStep(1, (conn) {
      return conn.execute('CREATE TABLE person(id INTEGER PRIMARY KEY, name TEXT NOT NULL)');
    }),
  ],
);

await database.open();

await database.connection.execute(
  'INSERT INTO person(id, name) VALUES (?, ?)',
  parameters: [1, 'Ada'],
  affectedTables: {'person'},
);

final names = SelectRunner(
  database: database,
  affectedTables: {'person'},
  query: () {
    return database.connection.select(
      'SELECT name FROM person ORDER BY id',
      (row) => row.readString(0),
    );
  },
);

print(await names.asList());
await database.close();
0
likes
130
points
90
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Dart runtime contracts for SQLiteNow generated code.

Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

sqlite3

More

Packages that depend on sqlitenow_runtime