- I installed `@types/uuid` because typescript required it in a file - In `packages/db-sqlite/src/index.ts` I see four more errors in my IDE that don't appear when I run the typecheck in the CLI with `tsc --noEmit`. The same thing happened in https://github.com/payloadcms/payload/pull/11560. Also referencing https://github.com/payloadcms/payload/pull/11226#issuecomment-2713898801 for traceability.
16 lines
374 B
TypeScript
16 lines
374 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
|
|
}
|
|
}
|