sqlite3_async 1.0.5 copy "sqlite3_async: ^1.0.5" to clipboard
sqlite3_async: ^1.0.5 copied to clipboard

Provides a subset of async operations on top of sqlite3 Database class.

sqlite3_async #

pub package

Provides a subset of async operations on top of sqlite3 plugin.

Features #

This package provides async operations for:

  • opening a Sqlite database
  • executing a SQL command
  • configuring DB user version
  • getting last inserted row id

Getting started #

To install this package run:

flutter pub add sqlite3_async

For Flutter applications you need to add the native SQLite library with:

flutter pub add sqlite3_flutter_libs

For other platforms, read sqlite3 docs

Usage #

import 'package:sqlite3_async/sqlite3_async.dart';

void main() async {
  var db = await AsyncDatabase.open("example.db");
  await db.execute("CREATE TABLE items("
      "id INTEGER PRIMARY KEY AUTOINCREMENT,"
      "name TEXT NOT NULL)");
  await db.execute("INSERT INTO items (name) VALUES (?)", ["book"]);
  await db.execute("INSERT INTO items (name) VALUES (?)", ["toy"]);

  var resultSet = await db
      .select("SELECT count(id) AS c FROM items");
  print('Results: $resultSet');
  await db.dispose();
}

Additional information #

If you encounter any problems or you feel the library is missing a feature, please raise a ticket on GitHub and I'll look into it. Pull request are also welcome.

2
likes
160
pub points
49%
popularity

Publisher

verified publisherhasna.ro

Provides a subset of async operations on top of sqlite3 Database class.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter, logging, logging_appenders, sqlite3

More

Packages that depend on sqlite3_async