Skip to content

Instantly share code, notes, and snippets.

View akshat-OwO's full-sized avatar
🚀

akshat akshat-OwO

🚀
View GitHub Profile
import * as PgDrizzle from "@effect/sql-drizzle/Pg";
import { PgClient } from "@effect/sql-pg";
import { Config, Effect } from "effect";
import * as schema from "~/lib/server/schema";
const PgLive = PgClient.layerConfig({
url: Config.redacted("DATABASE_URL"),
});
export class DrizzleClient extends Effect.Service<DrizzleClient>()("app/DrizzleClient", {
@t3dotgg
t3dotgg / try-catch.ts
Last active December 10, 2025 16:45
Theo's preferred way of handling try/catch in TypeScript
// Types for the result object with discriminated union
type Success<T> = {
data: T;
error: null;
};
type Failure<E> = {
data: null;
error: E;
};