sqlite_system 1.0.1
sqlite_system: ^1.0.1 copied to clipboard
async and sync sqlite bindings.
sqlite_system #
Simple SQLite bindings that link to the system SQLite shared library, with no build hooks.
All operations are synchronous except transaction. Don't share one Database across isolates.
Features #
- Parameter binding:
String,int,double,null,Uint8List(BLOB) select/selectOne,execute,executeAll(multiple statements)transactionandtransactionSync- Typed helpers:
selectT,selectOneT
Install #
dart pub add sqlite_system
Requires system SQLite (libsqlite3.so, sqlite3.dll, etc.) to be installed.
Usage #
import 'package:sqlite_system/sqlite_system.dart';
void main() {
final db = Database.open('app.db'); // or ':memory:'
db.execute('insert into users (name) values (?)', ['bob']);
final rows = db.select('select * from users where id = ?', [1]);
print(rows.first['name']);
db.close();
}
Why? #
The default SQLite package is great for big apps, but its build hooks added about 2 seconds to every rebuild. This package just binds to the system library instead.
Platforms #
Tested on Linux. Windows/macOS loaders exist but are untested.