Back to articles
Drizzle Studio Has a Free API That Most Developers Dont Know About

Drizzle Studio Has a Free API That Most Developers Dont Know About

via Dev.to WebdevAlex Spinov

Drizzle Studio is a built-in database GUI that comes free with Drizzle ORM. Browse, edit, and query your database from the browser. Launch npx drizzle-kit studio # Opens browser at https://local.drizzle.studio Drizzle ORM Setup // drizzle.config.ts import { defineConfig } from " drizzle-kit " ; export default defineConfig ({ schema : " ./src/db/schema.ts " , out : " ./drizzle " , dialect : " postgresql " , dbCredentials : { url : process . env . DATABASE_URL } }); Schema import { pgTable , serial , text , integer , timestamp , boolean } from " drizzle-orm/pg-core " ; export const users = pgTable ( " users " , { id : serial ( " id " ). primaryKey (), name : text ( " name " ). notNull (), email : text ( " email " ). unique (). notNull (), age : integer ( " age " ), active : boolean ( " active " ). default ( true ), createdAt : timestamp ( " created_at " ). defaultNow () }); export const posts = pgTable ( " posts " , { id : serial ( " id " ). primaryKey (), title : text ( " title " ). not

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
7 views

Related Articles