This is a continuation of the pokemon-csv-upload workshop. You do not need to do the csv upload workshop first, as this lesson will get you ready for the rest of the workshop, but this workshop does reference material that was taught in the previous workshop.
git@github.com:rust-adventure/pokemon-public-api-planetscale-netlify.git
git checkout lambda_http-0.8-starting-state
Create planetscale database using the UI. I've named mine pokemon
.
Then create a branch named new-tables
and run the create-tables.sql
script to create the relevant MySql schema.
pscale branch create pokemon new-tables
pscale shell pokemon new-tables
source ./crates/upload-pokemon-data/create-tables.sql
The branch needs to be merged into the main branch, then we can establish a connection to the database's main branch.
pscale connect pokemon main
and run our upload-pokemon-data
binary to insert the pokemon data.
DATABASE_URL=mysql://127.0.0.1 cargo run --bin upload-pokemon-data
At this point you should have a full database and are ready to continue.