Tuto from here
- Cli
cargo run -- --sqlite ./database.sqlite cli
- Api
cargo run -- --sqlite ./database.sqlite api
Create database
sqlite3 ./database.sqlite
Add tables
pragma foreign_keys = 1;
create table pokemons (
number integer primary key,
name text
);
create table types (
pokemon_number integer,
name text,
foreign key (pokemon_number) references pokemons (number) on delete cascade,
primary key (pokemon_number, name)
);