Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created September 20, 2022 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/48cb80de8b1ea07b458d0aca49fee454 to your computer and use it in GitHub Desktop.
Save parzibyte/48cb80de8b1ea07b458d0aca49fee454 to your computer and use it in GitHub Desktop.
await db.execute('''
CREATE TABLE IF NOT EXISTS Product (
id INTEGER PRIMARY KEY,
title TEXT
)
''');
await db.insert('Product', <String, Object?>{'title': 'Product 1'});
await db.insert('Product', <String, Object?>{'title': 'Product 1'});
var result = await db.query('Product');
print(result);
// prints [{id: 1, title: Product 1}, {id: 2, title: Product 1}]
await db.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment