Test, inspect, and ship

Change drivers and ship safely

Separate portable Drizzle habits from database-specific schema, transaction, connection, and migration decisions before deploying.

8 minute lesson

~~~

Drizzle supports many databases, but changing the driver is not the same as changing an import.

PostgreSQL uses pgTable, its own column builders, a network connection or pool, and PostgreSQL migration SQL. Cloudflare D1 uses SQLite schema builders and a D1 binding, but its batching and deployment workflow differ from local Node SQLite.

Keep repository functions small and pass the database client where tests need isolation. Keep connection creation near the runtime boundary. This makes a driver change visible without pretending the databases behave identically.

For production, run reviewed migrations as a controlled release step, back up important data, monitor errors and latency, and rehearse recovery. Never run destructive schema push automatically against a database you cannot recreate.

Choose Node SQLite, PostgreSQL, or D1 for one real application and justify concurrency, hosting, backup, and migration needs. Sketch the changed client and schema imports, then write a deploy and rollback checklist.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →