Database environment management for development and production PostgreSQL. Use when syncing data, running migrations, or debugging database issues.
shared/schema.tsnpm run db:push # Push schema changes to dev database
npx drizzle-kit push # Alternative direct push
npx drizzle-kit studio # Open Drizzle Studio for visual DB management
All Drizzle table definitions live in shared/schema.ts. When adding tables:
pgTable()createInsertSchema from drizzle-zodz.infer<typeof insertSchema>typeof table.$inferSelectnpm run db:push to applyManual process:
DATABASE_URL — Connection string (auto-set by Replit)PGHOST, PGPORT, PGUSER, PGPASSWORD, PGDATABASE — Individual connection paramsAll database operations go through server/storage.ts which implements IStorage.
Routes in server/routes.ts call storage methods — never raw SQL.
execute_sql tool for debugging only