Skip to content

Instantly share code, notes, and snippets.

View dBianchii's full-sized avatar
🇧🇷

Gabriel Bianchi dBianchii

🇧🇷
View GitHub Profile
@ikupenov
ikupenov / base.ts
Created November 10, 2024 09:58
Drizzle RLS DB with Policies
// schema/entities/base.ts
export const getBaseEntityProps = () => ({
id: uuid("id")
.default(sql`gen_random_uuid()`)
.primaryKey(),
createdAt: timestamp("created_at", { precision: 3 }).notNull().defaultNow(),
});
export const getOwnedBaseEntityProps = () => ({