added BaseIntrospector and reorganized connections

This commit is contained in:
dswbx
2025-03-07 17:20:37 +01:00
parent 25a3cb9655
commit 3704cad53a
15 changed files with 232 additions and 258 deletions

View File

@@ -13,6 +13,7 @@ import {
type Simplify,
sql,
} from "kysely";
import type { BaseIntrospector } from "./BaseIntrospector";
export type QB = SelectQueryBuilder<any, any, any>;
@@ -23,10 +24,6 @@ export type IndexMetadata = {
columns: { name: string; order: number }[];
};
export interface ConnectionIntrospector extends DatabaseIntrospector {
getIndices(tbl_name?: string): Promise<IndexMetadata[]>;
}
export interface SelectQueryBuilderExpression<O> extends AliasableExpression<O> {
get isSelectQueryBuilder(): true;
toOperationNode(): SelectQueryNode;
@@ -100,8 +97,8 @@ export abstract class Connection<DB = any> {
return conn[CONN_SYMBOL] === true;
}
getIntrospector(): ConnectionIntrospector {
return this.kysely.introspection as ConnectionIntrospector;
getIntrospector(): BaseIntrospector {
return this.kysely.introspection as any;
}
supportsBatching(): boolean {