260411
260411

260411

Stella

Backlinks (0)

No backlinks found.

컴퓨트로늄
컴퓨트로늄

컴퓨트로늄

컴퓨트로늄 컴퓨트로늄

Backlinks (0)

No backlinks found.

260418
260418

260418

  • AutoBuilder
  • @github@anaclumos@rsc-swr
Backlinks (0)

No backlinks found.

PlanetScale DB 하나로 수많은 프로젝트 호스팅
PlanetScale DB 하나로 수많은 프로젝트 호스팅

PlanetScale DB 하나로 수많은 프로젝트 호스팅

이미 인수된 기업의 제품을 쓰는 것을 안 좋아하기도 해서, 최근 대부분의 프로젝트 및 앞으로 프로젝트를 PlanetScale DB로 옮기려고 했다. 영속적인 기업을 만들고자 하는 철학이 마음에 들기도 했고, 장기적으로 PlanetScale을 쓰는 것을 연습해야겠다고 생각하기도 했고. 아무튼 다음은 PlanetScale DB 하나로 많은 프로젝트를 호스팅하는 방법이다.

typescript
// src/db/schema.tsimport { pgSchema, text, timestamp, uuid } from 'drizzle-orm/pg-core'
// Define a schema for the project (not Postgres's default public)export const myProject = pgSchema('my_project')
// Create all tables under this schemaexport const users = myProject.table('users', {  id: uuid('id').defaultRandom().primaryKey(),  name: text('name').notNull(),  createdAt: timestamp('created_at').notNull().defaultNow(),})
export type User = typeof users.$inferSelect
typescript
// drizzle.config.tsimport { defineConfig } from 'drizzle-kit'
export default defineConfig({  schema: './src/db/schema.ts',  out: './drizzle',  dialect: 'postgresql',  dbCredentials: {    url: process.env.DATABASE_URL!,  },  // Isolate the schema with the project codename  schemaFilter: ['my_project'],  // Save the migration to the schema of the project codename  migrations: {    schema: 'my_project',    table: '__drizzle_migrations',  },})
typescript
// src/db/index.tsimport { drizzle } from 'drizzle-orm/node-postgres'import * as schema from './schema'
export const db = drizzle(process.env.DATABASE_URL!, { schema })
Backlinks (1)
  • 260111
Index
cho.sh
I prefer CLIBB9A08260619260619컴퓨트로늄37A88F컴퓨트로늄0CF03F컴퓨트로늄2C60FB260618260618260418260418260528260528AutoBuilder63849A260419260419Setup9AC296StellaD226F7260415260415Debian SetupD2F701260414260414anaclumos/configs/AGENTS.mdED86A3Ramp의 AX (회사를 AI로 물들이는 법)840774260413260413How to get your company AI pilled46544C260411260411260409260409260407260407260406260406Separating Claude Code Personal Sub and Claude Code Company Sub33A53C
// src/db/schema.tsimport { pgSchema, text, timestamp, uuid } from 'drizzle-orm/pg-core'
// Define a schema for the project (not Postgres's default public)export const myProject = pgSchema('my_project')
// Create all tables under this schemaexport const users = myProject.table('users', {  id: uuid('id').defaultRandom().primaryKey(),  name: text('name').notNull(),  createdAt: timestamp('created_at').notNull().defaultNow(),})
export type User = typeof users.$inferSelect
// drizzle.config.tsimport { defineConfig } from 'drizzle-kit'
export default defineConfig({  schema: './src/db/schema.ts',  out: './drizzle',  dialect: 'postgresql',  dbCredentials: {    url: process.env.DATABASE_URL!,  },  // Isolate the schema with the project codename  schemaFilter: ['my_project'],  // Save the migration to the schema of the project codename  migrations: {    schema: 'my_project',    table: '__drizzle_migrations',  },})
// src/db/index.tsimport { drizzle } from 'drizzle-orm/node-postgres'import * as schema from './schema'
export const db = drizzle(process.env.DATABASE_URL!, { schema })