Angelelz / drizzle-playground

Repository from Github https://github.comAngelelz/drizzle-playgroundRepository from Github https://github.comAngelelz/drizzle-playground

Drizzle Playground

image

https://orm.drizzle.team/

Just a little repo to play around with drizzle.

It includes all major drivers, ready to be used.

Import and write your queries in main function in index.ts, then run (npm|pnpm|yarn) run start.

How to

Copy the .env.example file to .env and fill it

You can keep the default values (they are the ones used in the docker-compose.yml file)

Start local DB

It requires Docker to be installed (https://docs.docker.com/get-docker/)

# In a terminal, run
docker compose up

# ctrl + c to stop

Push the schema to the DB

It depends on the DB

# In a terminal, run
(npm|pnpm|yarn) run {dialect}:push

(npm|pnpm|yarn) run pg:push

Start Drizzle Studio

It depends on the DB Push your schema before starting the studio. Or restart the studio after pushing the schema.

# In a terminal, run
(npm|pnpm|yarn) run {dialect}:studio

(npm|pnpm|yarn) run pg:studio

I am stuck, I have errors on push

Delete the docker containers and start again 😂.

Stop the compose with ctrl + c.

# In a terminal, run
docker rm db-mysql # or docker rm db-postgres or both

About


Languages

Language:TypeScript 99.7%Language:JavaScript 0.3%