Skip to content

Instantly share code, notes, and snippets.

View uncomplexity's full-sized avatar

uncomplexity

  • Uncomplexities, Inc.
View GitHub Profile
@alexander-azizi-martin
alexander-azizi-martin / README.md
Last active December 26, 2025 06:26
Kysely ORM

Overview

This library provides an API similar to drizzle's relations so that kysely can be used as an ORM.

Usage

interface Database {
  users: { id: number; name: string };
  posts: { id: number; user_id: number; title: string };
@rphlmr
rphlmr / clear-db.ts
Last active December 26, 2025 17:04
Drizzle snippets
// Credits to Louistiti from Drizzle Discord: https://discord.com/channels/1043890932593987624/1130802621750448160/1143083373535973406
import { sql } from "drizzle-orm";
const clearDb = async (): Promise<void> => {
const query = sql<string>`SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public'
AND table_type = 'BASE TABLE';
`;