Skip to content

Drizzle Commands

There are several commands related to drizzle, and all of these accept the --stage flag from SST.

json
"db:studio": "bash scripts/helpers/studio.sh",
"db:generate": "bash scripts/helpers/db.sh generate",
"db:migrate": "bash scripts/helpers/db.sh migrate",
"db:push": "bash scripts/helpers/db.sh push",
"db:pull": "bash scripts/helpers/db.sh pull",
"db:drop": "bash scripts/helpers/db.sh drop"

The db:studio command also runs in the multiplexer. You can control weather or not to autostart it in the config file.

Tunnel

To connect to RDS you need to have the SST tunnel running. The db:studio command handles this for you, but all the other commands do not, so you'll need to be running bunx sst tunnel in another terminal.

🧀 This might be a nice feature update, we could concurrently run tunnel and then the given command.

Electric

Electric is the sync engine that works with our RDS instance, and runs on an EC2 instance inside a Docker container.

The userData for the EC2 instance should handle most of the set up, but there might be situations when you need to dive into the instance. You can do so via SSM like this

bun run tunnel:electric

Electric should be running as a docker instance, so sudo docker ps might be a good place to start. You can also simply check the health status of the instance.

bun run health:electric