use Create t3 app to make a TODO list demo.
here recommend a package manager library: ni
- first, make an env file to store the database URL.
echo 'DATABASE_URL="file:./dev.db"' > .env
if you wanna use another database, you can change the DATABASE_URL
to your own database URL.
for example MySQL: mysql://USER:PASSWORD@HOST:PORT/DATABASE
more details: Prisma
- therefore, we have the schema
/prisma/schema.prisma
, then create the database,
# this will generate some files in /prisma
nx prisma migrate dev --name init
- if you change the schema info, you must execute the command below to update the database.
nx prisma generate
- now, we can start the server.
nr dev