Files
payload/packages/drizzle/src/destroy.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

18 lines
506 B
TypeScript

import type { Destroy } from 'payload'
import type { DrizzleAdapter } from './types.js'
// eslint-disable-next-line @typescript-eslint/require-await
export const destroy: Destroy = async function destroy(this: DrizzleAdapter) {
if (this.enums) this.enums = {}
this.schema = {}
this.tables = {}
this.relations = {}
this.fieldConstraints = {}
this.drizzle = undefined
this.initializing = new Promise((res, rej) => {
this.resolveInitializing = res
this.rejectInitializing = rej
})
}