Skip to content

Instantly share code, notes, and snippets.

@simolus3
Created April 8, 2020 09:07
Show Gist options
  • Save simolus3/47cbdf7e46ec8e68293c0a2cdd8533c2 to your computer and use it in GitHub Desktop.
Save simolus3/47cbdf7e46ec8e68293c0a2cdd8533c2 to your computer and use it in GitHub Desktop.
import 'package:moor_ffi/database.dart';
void main() {
final db = Database.memory();
db.execute('''
CREATE TABLE ravs(
id INTEGER NOT NULL PRIMARY KEY,
originalId INTEGER NOT NULL,
sourceId INTEGER NOT NULL,
totalCount INTEGER NOT NULL,
rav TEXT NOT NULL
);
''');
db.execute("INSERT INTO ravs VALUES(1,1,1,1, 'הרב נתנאל אלישיב');");
final stmt = db.prepare('SELECT * FROM ravs WHERE rav LIKE ?');
for (final row in stmt.select(['%הרב %'])) {
print(row);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment