Files
payload/packages/db-postgres/src/dropDatabase.ts
Dan Ribbens 09ad6e4280 feat(drizzle): abstract shared sql code to new package (#7320)
- Abstract shared sql code to a new drizzle package
- Adds sqlite package, not ready to publish until drizzle patches some
issues
- Add `transactionOptions` to allow customizing or disabling db
transactions
- Adds "experimental" label to the `schemaName` property until drizzle
patches an issue
2024-07-24 12:43:29 -04:00

10 lines
320 B
TypeScript

import type { DropDatabase } from './types.js'
export const dropDatabase: DropDatabase = async function dropDatabase({ adapter }) {
await adapter.execute({
drizzle: adapter.drizzle,
raw: `drop schema if exists ${this.schemaName || 'public'} cascade;
create schema ${this.schemaName || 'public'};`,
})
}