Skip to content

Instantly share code, notes, and snippets.

View Glazy's full-sized avatar

Luke Glazy

View GitHub Profile
@Glazy
Glazy / timestamps.ts
Created February 18, 2025 17:36
Kysely Timestamps
// database/timestamps.ts
import { Kysely, sql } from 'kysely'
/**
* Creates a Postgres function which will update the `updated_at` column every
* time the row is modified.
*/
export async function addPostgresTimestampFunction(
db: Kysely<any>,
): Promise<void> {