mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-12-23 08:21:09 +00:00
| .. | ||
| android | ||
| cargokit | ||
| example | ||
| ios | ||
| lib | ||
| linux | ||
| macos | ||
| rust | ||
| test | ||
| test_driver | ||
| windows | ||
| .gitignore | ||
| .metadata | ||
| analysis_options.yaml | ||
| cargokit_options.yaml | ||
| CHANGELOG.md | ||
| DEVELOPMENT.md | ||
| flutter_rust_bridge.yaml | ||
| LICENSE | ||
| pubspec.lock | ||
| pubspec.yaml | ||
| README.md | ||
turso_dart
Dart/Flutter binding for turso database.
Getting Started
Add it to your pubspec.yaml.
turso_dart:
Create the client
- In memory
final client = TursoClient.memory();
- Local
final dir = await getApplicationCacheDirectory();
final path = '${dir.path}/local.db';
final client = TursoClient.local(path);
Connect
await client.connect();
Run SQL statements
- Create table
await client.execute("create table if not exists customers (id integer primary key, name text);");
- Insert query
await client.query("insert into customers(name) values ('John Doe')");
- Select query
print(await client.query("select * from customers"));
- Prepared statement
final statement = await client
.prepare("select * from customers where id = ?");
await statement.query(positional: [1])