driftsql 1.0.32 → 2.0.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +276 -96
- package/dist/index.d.ts +360 -37
- package/dist/index.js +81 -21
- package/dist/postgres-9C7eE0wB.js +5 -0
- package/dist/postgres-DWtAqXNK.js +1 -0
- package/dist/type-generator-Ba8bgnMm.js +7 -0
- package/dist/type-generator-DbcqBk-4.js +1 -0
- package/package.json +37 -24
- package/.prettierrc +0 -5
- package/dist/drivers/bun.d.ts +0 -22
- package/dist/drivers/libsql.d.ts +0 -23
- package/dist/drivers/mysql.d.ts +0 -20
- package/dist/drivers/neon.d.ts +0 -19
- package/dist/drivers/postgres.d.ts +0 -26
- package/dist/drivers/poubelle/client.d.ts +0 -20
- package/dist/drivers/poubelle/poubelle.d.ts +0 -11
- package/dist/drivers/sqlitecloud.d.ts +0 -21
- package/dist/drivers/surreal.d.ts +0 -17
- package/dist/inspect.d.ts +0 -7
- package/dist/pull.d.ts +0 -7
- package/dist/types.d.ts +0 -49
- package/tsconfig.json +0 -34
package/dist/types.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
export interface QueryResult<T = any> {
|
|
2
|
-
rows: T[];
|
|
3
|
-
rowCount: number;
|
|
4
|
-
command?: string;
|
|
5
|
-
fields?: QueryField[];
|
|
6
|
-
}
|
|
7
|
-
export interface QueryField {
|
|
8
|
-
name: string;
|
|
9
|
-
dataTypeID: number;
|
|
10
|
-
}
|
|
11
|
-
export interface DatabaseDriver {
|
|
12
|
-
query<T = any>(sql: string, params?: any[]): Promise<QueryResult<T>>;
|
|
13
|
-
findFirst?(table: string, where?: Record<string, any>): Promise<QueryResult<any> | null>;
|
|
14
|
-
findMany?(table: string, options?: {
|
|
15
|
-
where?: Record<string, any>;
|
|
16
|
-
limit?: number;
|
|
17
|
-
offset?: number;
|
|
18
|
-
}): Promise<QueryResult<any>>;
|
|
19
|
-
insert?(table: string, data: Record<string, any>): Promise<QueryResult<any>>;
|
|
20
|
-
update?(table: string, data: Record<string, any>, where: Record<string, any>): Promise<QueryResult<any>>;
|
|
21
|
-
delete?(table: string, where: Record<string, any>): Promise<number>;
|
|
22
|
-
close(): Promise<void>;
|
|
23
|
-
}
|
|
24
|
-
export interface TransactionCapable {
|
|
25
|
-
transaction<T>(callback: (driver: DatabaseDriver) => Promise<T>): Promise<T>;
|
|
26
|
-
}
|
|
27
|
-
export interface PreparedStatementCapable {
|
|
28
|
-
prepare(sql: string): Promise<PreparedStatement>;
|
|
29
|
-
}
|
|
30
|
-
export interface PreparedStatement {
|
|
31
|
-
execute<T = any>(params?: any[]): Promise<QueryResult<T>>;
|
|
32
|
-
finalize(): Promise<void>;
|
|
33
|
-
}
|
|
34
|
-
export declare function hasTransactionSupport(driver: DatabaseDriver): driver is DatabaseDriver & TransactionCapable;
|
|
35
|
-
export declare function hasPreparedStatementSupport(driver: DatabaseDriver): driver is DatabaseDriver & PreparedStatementCapable;
|
|
36
|
-
export declare class DatabaseError extends Error {
|
|
37
|
-
readonly driverType: string;
|
|
38
|
-
readonly originalError?: Error | undefined;
|
|
39
|
-
constructor(message: string, driverType: string, originalError?: Error | undefined);
|
|
40
|
-
}
|
|
41
|
-
export declare class QueryError extends DatabaseError {
|
|
42
|
-
constructor(driverType: string, sql: string, originalError?: Error);
|
|
43
|
-
}
|
|
44
|
-
export declare class ConnectionError extends DatabaseError {
|
|
45
|
-
constructor(driverType: string, originalError?: Error);
|
|
46
|
-
}
|
|
47
|
-
export interface DriverOptions {
|
|
48
|
-
[key: string]: any;
|
|
49
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
// Enable latest features
|
|
4
|
-
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
|
5
|
-
"target": "ESNext",
|
|
6
|
-
"module": "Preserve",
|
|
7
|
-
"moduleDetection": "force",
|
|
8
|
-
"resolveJsonModule": true,
|
|
9
|
-
"isolatedModules": true,
|
|
10
|
-
"jsx": "react-jsx",
|
|
11
|
-
"allowJs": true,
|
|
12
|
-
// Bundler mode
|
|
13
|
-
"moduleResolution": "bundler",
|
|
14
|
-
"allowImportingTsExtensions": true,
|
|
15
|
-
"verbatimModuleSyntax": true,
|
|
16
|
-
// Best practices
|
|
17
|
-
"strict": true,
|
|
18
|
-
"skipLibCheck": true,
|
|
19
|
-
"noFallthroughCasesInSwitch": true,
|
|
20
|
-
// Some stricter flags (disabled by default)
|
|
21
|
-
"noUnusedLocals": false,
|
|
22
|
-
"noImplicitAny": true,
|
|
23
|
-
"noImplicitOverride": true,
|
|
24
|
-
"noImplicitThis": true,
|
|
25
|
-
"noUnusedParameters": false,
|
|
26
|
-
"noPropertyAccessFromIndexSignature": false,
|
|
27
|
-
// Output declarations
|
|
28
|
-
"declaration": true,
|
|
29
|
-
"declarationDir": "dist",
|
|
30
|
-
"emitDeclarationOnly": true,
|
|
31
|
-
"stripInternal": true
|
|
32
|
-
},
|
|
33
|
-
"include": ["src"]
|
|
34
|
-
}
|