- 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
16 lines
370 B
TypeScript
16 lines
370 B
TypeScript
import { sql } from 'drizzle-orm'
|
|
|
|
import type { Execute } from './types.js'
|
|
|
|
export const execute: Execute<any> = function execute({ db, drizzle, raw, sql: statement }) {
|
|
const executeFrom = db ?? drizzle
|
|
|
|
if (raw) {
|
|
const result = executeFrom.run(sql.raw(raw))
|
|
return result
|
|
} else {
|
|
const result = executeFrom.run(statement)
|
|
return result
|
|
}
|
|
}
|