1

Install

Add the turso_dart package to your pubspec.yaml:
dependencies:
  turso_dart:
Then run:
dart pub get
2

Connect

Create a client connection. You can connect to an in-memory database or a local file:
import 'package:turso_dart/turso_dart.dart';

// In memory
final client = TursoClient.memory();

// Or local file
final client = TursoClient.local('/path/to/local.db');

await client.connect();
3

Create table

Create a table for customers:
await client.execute(
  "CREATE TABLE IF NOT EXISTS customers (id INTEGER PRIMARY KEY, name TEXT)"
);
4

Insert data

Insert some data into the customers table:
await client.query("INSERT INTO customers(name) VALUES ('John Doe')");
await client.query("INSERT INTO customers(name) VALUES ('Jane Smith')");
5

Query data

Query all customers from the table:
final result = await client.query("SELECT * FROM customers");
print(result);
6

Prepared statements

Use prepared statements for better performance and security:
final statement = await client.prepare("SELECT * FROM customers WHERE id = ?");
final result = await statement.query(positional: [1]);
print(result);