All files server/types/executor.ts

0% Statements 0/0
0% Branches 0/0
0% Functions 0/0
0% Lines 0/0

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25                                                 
/**
 * Database executor type definitions
 * Interfaces for database execution with different engines
 */
 
import type { SQL } from 'drizzle-orm'
import type { DrizzleDatabase } from './core'
import type { DatabaseAdapter } from '../adapters/base-adapter'
 
/**
 * Database executor interface that wraps Drizzle ORM
 * Provides type-safe SQL execution with engine-specific implementations
 */
export interface DatabaseExecutor {
  /** The Drizzle database instance */
  db: DrizzleDatabase
  /** Optional schema for type inference */
  schema?: any
  /** Database adapter for SQL dialect-specific operations */
  databaseAdapter: DatabaseAdapter
  /** Execute a Drizzle SQL query or query object */
  execute<T = any[]>(query: SQL | any, numericFields?: string[]): Promise<T>
  /** Get the database engine type */
  getEngineType(): 'postgres' | 'mysql' | 'sqlite' | 'singlestore'
}