Skip to content

Instantly share code, notes, and snippets.

View erikmunson's full-sized avatar

Erik Munson erikmunson

View GitHub Profile
@erikmunson
erikmunson / drizzleConnectionProvider.ts
Last active April 18, 2025 00:16
Zero Drizzle custom mutator example (postgres.js)
import { drizzle as drizzleBuilder } from 'drizzle-orm/postgres-js'
import postgres from 'postgres'
import type { DBConnection, DBTransaction, Row } from '@rocicorp/zero/pg'
// drizzle schema
import * as schema from './schema'
// build your drizzle client instance as per usual
const drizzle = drizzleBuilder(
postgres(DB_CONNECTION_STRING, /* options... */),
@erikmunson
erikmunson / sst.config.ts
Last active January 11, 2025 19:15
Zero SST test/prototype example
/// <reference path="./.sst/platform/config.d.ts" />
const BASE_DOMAIN_CERT_ARN =
'<cert ARN in AWS for your domain>'
const buildServiceDomainName = (slug: string) => {
// build whatever domain you like
const baseDomain = `${$app.stage}.mydomain.com`
return `${slug}.${baseDomain}`
}