generate
migrate
push
pull
export
check
up
studio
npm i drizzle-orm @aws-sdk/client-rds-data npm i -D drizzle-kit
yarn add drizzle-orm @aws-sdk/client-rds-data yarn add -D drizzle-kit
pnpm add drizzle-orm @aws-sdk/client-rds-data pnpm add -D drizzle-kit
bun add drizzle-orm @aws-sdk/client-rds-data bun add -D drizzle-kit
import { drizzle } from 'drizzle-orm/aws-data-api-pg'; // 다음 세 가지 속성은 필수입니다. 연결 객체 내부에 // RDSDataClient 타입의 어떤 속성도 지정할 수 있습니다. const db = drizzle({ connection: { database: process.env['DATABASE']!, secretArn: process.env['SECRET_ARN']!, resourceArn: process.env['RESOURCE_ARN']!, } }); await db.select().from(...);
기존 드라이버를 제공해야 하는 경우:
import { drizzle } from 'drizzle-orm/aws-data-api/pg'; import { RDSDataClient } from '@aws-sdk/client-rds-data'; const rdsClient = new RDSDataClient({ region: 'us-east-1' }); const db = drizzle(rdsClient, { database: process.env['DATABASE']!, secretArn: process.env['SECRET_ARN']!, resourceArn: process.env['RESOURCE_ARN']!, }); await db.select().from(...);
Manage schema
Query data