import { type AbstractType, type Constructor, type Field, type FieldType } from "@dao-xyz/borsh"; import * as types from "@peerbit/indexer-interface"; import { type PlanningSession } from "./query-planner.js"; export type SQLLiteValue = string | number | null | bigint | Uint8Array | Int8Array | ArrayBuffer; export type BindableValue = string | bigint | number | Uint8Array | Int8Array | ArrayBuffer | null; export declare const coerceLocalQueries: (query?: types.Query[] | types.Query | Record) => types.Query[]; export declare const coerceLocalSorts: (sort?: types.Sort[] | types.Sort) => types.Sort[] | types.Sort | undefined; export declare const u64ToI64: (u64: bigint | number) => bigint; export declare const i64ToU64: (i64: number | bigint) => bigint; export declare const convertToSQLType: (value: boolean | bigint | string | number | Uint8Array, type?: FieldType) => BindableValue; export declare const escapeColumnName: (name: string, char?: string) => string; export declare class MissingFieldError extends Error { constructor(message: string); } export declare const convertFromSQLType: (value: boolean | bigint | string | number | Uint8Array, type: FieldType | undefined) => any; export declare const toSQLType: (type: FieldType, isOptional?: boolean) => string; type SQLField = { name: string; key: string; definition: string; type: string; isPrimary: boolean; from: Field | undefined; unwrappedType: FieldType | undefined; path: string[]; describesExistenceOfAnother?: string; }; type SQLConstraint = { name: string; definition: string; }; export interface Table { name: string; ctor: Constructor; primary: string | false; primaryIndex: number; primaryField?: SQLField; path: string[]; parentPath: string[] | undefined; fields: SQLField[]; constraints: SQLConstraint[]; children: Table[]; inline: boolean; parent: Table | undefined; referencedInArray: boolean; isSimpleValue: boolean; indices: Set; } export declare const getSQLTable: (ctor: AbstractType, path: string[], primary: string | false, inline: boolean, addJoinField: ((fields: SQLField[], constraints: SQLConstraint[]) => void) | undefined, fromOptionalField?: boolean) => Table[]; export declare const getTableName: (path: string[] | undefined, clazz: string | Constructor) => any; export declare const CHILD_TABLE_ID = "__id"; export declare const ARRAY_INDEX_COLUMN = "__index"; export declare const PARENT_TABLE_ID = "__parent_id"; export declare const getSQLFields: (tableName: string, path: string[], ctor: Constructor, primary: string | false, addJoinFieldFromParent?: (fields: SQLField[], constraints: SQLConstraint[]) => void, tables?: Table[], isOptional?: boolean) => { fields: SQLField[]; constraints: SQLConstraint[]; dependencies: Table[]; }; export declare const resolveTable: (key: string[], tables: Map, clazz: string | Constructor, throwOnMissing: B) => R; export declare const insert: (insertFn: (values: any[], table: Table, options?: { requireId?: boolean; }) => Promise | any, obj: Record, tables: Map, table: Table, fields: Field[], handleNestedCallback?: (cb: (parentId: any) => Promise) => Promise | void | number, parentId?: any, index?: number, options?: { insertSimpleVecRows?: (rows: any[][], table: Table) => Promise | void; }) => Promise; export declare const getTablePrefixedField: (table: Table, key: string, skipPrefix?: boolean) => string; export declare const getTableNameFromPrefixedField: (prefixedField: string) => string; export declare const getInlineTableFieldName: (path: string[] | string | undefined, key?: string) => string; export declare const selectChildren: (childrenTable: Table) => string; export declare const generateSelectQuery: (table: Table, selects: { from: string; as: string; }[]) => string; export declare const selectAllFieldsFromTables: (tables: Table[], shape: types.Shape | undefined) => { selects: { from: string; as: string; }[]; joins: Map; groupBy: string | undefined; }[]; export declare const selectAllFieldsFromTable: (table: Table, shape: types.Shape | undefined) => { groupBy: string | undefined; selects: { from: string; as: string; }[]; join: Map; }; export declare const resolveInstanceFromValue: (fromTablePrefixedValues: Record, tables: Map, table: Table, resolveChildren: (parentId: any, table: Table) => Promise, tablePrefixed: boolean, shape?: S) => Promise>; export declare const fromRowToObj: (row: any, ctor: Constructor) => any; export declare const convertDeleteRequestToQuery: (request: types.DeleteOptions, tables: Map, table: Table, options?: { planner?: PlanningSession; }) => { sql: string; bindable: any[]; }; export declare const convertSumRequestToQuery: (request: types.SumOptions, tables: Map, table: Table, options?: { planner?: PlanningSession; }) => { sql: string; bindable: any[]; }; export declare const convertCountRequestToQuery: (request: types.CountOptions | undefined, tables: Map, table: Table) => { sql: string; bindable: any[]; }; export declare const convertSearchRequestToQuery: (request: { query: types.Query[]; sort?: types.Sort[] | types.Sort; } | undefined, tables: Map, rootTables: Table[], options?: { shape?: types.Shape | undefined; fetchAll?: boolean; planner?: PlanningSession; }) => { sql: string; bindable: any[]; }; export declare const buildJoin: (joinBuilder: Map, options?: { planner?: PlanningSession; }) => { join: string; }; export declare const convertQueryToSQLQuery: (query: types.Query, tables: Map, table: Table, joinBuilder: Map, path: string[], tableAlias: string | undefined, skipKeys: number) => { where: string; bindable: any[]; }; type JoinOrRootTable = JoinTable | RootTable; type JoinTable = { table: Table; as: string; type: "left" | "cross"; columns: string[]; }; type RootTable = { type: "root"; table: Table; as: string; columns: string[]; }; export {}; //# sourceMappingURL=schema.d.ts.map