To run typescript scripts look at the ts-node
setup in tsconfig.json
.
npm create svelte@latest svelte-sqlite-ex1
npm i
npm i -D better-sqlite3
npm i -D @types/better-sqlite3
npm i -D sqlite3
sudo apt install sqlite3
sudo apt-get install sqlitebrowser
npm i -D ts-node # to run ts script files
npm install @picocss/pico
# install and connect
npm install prisma --save-dev
npx prisma init --datasource-provider sqlite
# pull schema
npx prisma db pull --force
# create and apply initial migration
mkdir -p prisma/migrations/0_init
npx prisma migrate diff --from-empty --to-schema-datamodel prisma/schema.prisma --script > prisma/migrations/0_init/migration.sql
npx prisma migrate resolve --applied 0_init
# install client
npm install @prisma/client
npx prisma generate
The code in this repository is based on the following videos.
Use the chinook sample db.