Lecture starter and solution code for database lectures
Install dependencies and create starter and solution databases
bun install
cp .env.template .env
touch starter/myDB.sqlite
touch solution/solutionDB.sqlite
This will create a starter and solution database in the starter
and solution
directories respectively.
All scripts in the package.json have either a starter
or solution
suffix to indicate which database they are running on.
To push your schema to the database, run:
bun db:push:starter # For starter database
bun db:push:solution # For solution database
Once you have a schema, you can also run a the provided seed script for either the starter or solution database.
bun starter/seed.ts # For solution database
bun solution/seed.ts # For starter database
Create a data model for a blogging platform.
Write Drizzle queries to interact with the database.
keyset vs ordered pagination: https://medium.com/@alina.glumova/from-offset-to-cursors-exploring-the-spectrum-of-pagination-techniques-in-relational-databases-6ca7e1b561b0
planet scale mysql course: https://planetscale.com/learn/courses/mysql-for-developers
Learn advanced database topics: foreign key actions, transactions, and migrations.