0
0
mirror of https://github.com/tursodatabase/libsql.git synced 2025-07-03 05:08:05 +00:00
Files
libsql/sqlx-libsql/examples/todos/README.md
2024-09-27 16:44:33 -04:00

42 lines
398 B
Markdown

# TODOs Example
## Setup
1. Declare the database URL
```
export DATABASE_URL="sqlite:todos.db"
```
2. Create the database.
```
$ sqlx db create
```
3. Run sql migrations
```
$ sqlx migrate run
```
## Usage
Add a todo
```
cargo run -- add "todo description"
```
Complete a todo.
```
cargo run -- done <todo id>
```
List all todos
```
cargo run
```