drizzle-kit 0.20.17-aec19bb → 0.20.17-b08243d

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,51 @@
1
+ import { Hono } from "hono";
2
+ import type { PostgresCredentials } from "../cli/validations/pg";
3
+ import type { MysqlCredentials } from "../cli/validations/mysql";
4
+ import type { SqliteCredentials } from "../cli/validations/sqlite";
5
+ import { AnyPgTable } from "drizzle-orm/pg-core";
6
+ import { Relations } from "drizzle-orm";
7
+ import { AnyMySqlTable } from "drizzle-orm/mysql-core";
8
+ import { AnySQLiteTable } from "drizzle-orm/sqlite-core";
9
+ type CustomDefault = {
10
+ schema: string;
11
+ table: string;
12
+ column: string;
13
+ func: () => unknown;
14
+ };
15
+ export type Setup = {
16
+ dialect: "postgresql" | "mysql" | "sqlite";
17
+ proxy: (params: ProxyParams) => Promise<any[] | any>;
18
+ customDefaults: CustomDefault[];
19
+ };
20
+ export type ProxyParams = {
21
+ sql: string;
22
+ params: any[];
23
+ mode: "array" | "object";
24
+ method: "values" | "get" | "all" | "run" | "execute";
25
+ };
26
+ export declare const preparePgSchema: (path: string | string[]) => Promise<{
27
+ schema: Record<string, Record<string, AnyPgTable>>;
28
+ relations: Record<string, Relations<string, Record<string, import("drizzle-orm").Relation<string>>>>;
29
+ }>;
30
+ export declare const prepareMySqlSchema: (path: string | string[]) => Promise<{
31
+ schema: Record<string, Record<string, AnyMySqlTable>>;
32
+ relations: Record<string, Relations<string, Record<string, import("drizzle-orm").Relation<string>>>>;
33
+ }>;
34
+ export declare const prepareSQLiteSchema: (path: string | string[]) => Promise<{
35
+ schema: Record<string, Record<string, AnySQLiteTable>>;
36
+ relations: Record<string, Relations<string, Record<string, import("drizzle-orm").Relation<string>>>>;
37
+ }>;
38
+ export declare const drizzleForPostgres: (credentials: PostgresCredentials, pgSchema: Record<string, Record<string, AnyPgTable>>, relations: Record<string, Relations>) => Promise<Setup>;
39
+ export declare const drizzleForMySQL: (credentials: MysqlCredentials, mysqlSchema: Record<string, Record<string, AnyMySqlTable>>, relations: Record<string, Relations>) => Promise<Setup>;
40
+ export declare const drizzleForSQLite: (credentials: SqliteCredentials, sqliteSchema: Record<string, Record<string, AnySQLiteTable>>, relations: Record<string, Relations>) => Promise<Setup>;
41
+ export type Server = {
42
+ start: (params: {
43
+ host: string;
44
+ port: number;
45
+ key?: string;
46
+ cert?: string;
47
+ cb: (err: Error | null, address: string) => void;
48
+ }) => void;
49
+ };
50
+ export declare const prepareServer: ({ dialect, proxy, customDefaults }: Setup, app?: Hono) => Promise<Server>;
51
+ export {};