sqlite_db 1.0.0 copy "sqlite_db: ^1.0.0" to clipboard
sqlite_db: ^1.0.0 copied to clipboard

A SQLite database client.

example/example.dart

// ignore_for_file: lines_longer_than_80_chars

import 'package:sqlite_db/sqlite_db.dart';

void main() async {
  final db = const SQLiteDbFactory().create(
    const DbConnectionData(
      hostDirectoryPath: '.',
      name: 'example.db',
      version: 1,
    ),
    const DbInitializerScripts(
      creationScripts: [
        SingleVersionedDbScript(
          scriptText:
              'CREATE TABLE IF NOT EXISTS users (id TEXT PRIMARY KEY, name TEXT)',
          targetVersion: 1,
        ),
      ],
    ),
  );

  await db.initialize();

  await db.insert('users', [
    {'id': '1', 'name': 'Alice'},
  ]);

  final rows = await db.get('users', 'id', ['1']);
  print('User: ${rows.first['name']}');

  await db.dispose();
}
0
likes
150
points
111
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A SQLite database client.

Homepage
Repository (GitHub)
View/report issues

License

BSD-3-Clause (license)

Dependencies

flutter, meta, path, sqflite

More

Packages that depend on sqlite_db