UNPKG

artmapper

Version:

A simple and intuitive ORM for Node.js with TypeScript and JavaScript support

86 lines 1.81 kB
import { ModelDefinition, QueryOptions, DatabaseType } from './types'; export declare class QueryBuilder { private definition; private databaseType; constructor(definition: ModelDefinition, databaseType: DatabaseType); /** * Build SELECT query */ buildSelect(options?: QueryOptions): { sql: string; params: any[]; }; /** * Build INSERT query */ buildInsert(data: Record<string, any>): { sql: string; params: any[]; }; /** * Build UPDATE query */ buildUpdate(id: any, data: Record<string, any>): { sql: string; params: any[]; }; /** * Build DELETE query */ buildDelete(id: any): { sql: string; params: any[]; }; /** * Build COUNT query */ buildCount(options?: QueryOptions): { sql: string; params: any[]; }; /** * Build CREATE TABLE query */ buildCreateTable(): string; /** * Build DROP TABLE query */ buildDropTable(): string; /** * Build WHERE clause */ private buildWhereClause; /** * Build ORDER BY clause */ private buildOrderByClause; /** * Build field definition for CREATE TABLE */ private buildFieldDefinition; /** * Map field type to database-specific type */ private mapFieldType; /** * Get placeholders for parameterized queries */ private getPlaceholders; /** * Get single placeholder */ private getPlaceholder; /** * Quote table name */ private quoteTable; /** * Quote field name */ private quoteField; /** * Quote value for default */ private quoteValue; } //# sourceMappingURL=query.d.ts.map