driftsql 1.0.30 → 1.0.31
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.
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type DatabaseDriver, type QueryResult } from '../types';
|
|
2
|
+
interface BunConfig {
|
|
3
|
+
connectionString: string;
|
|
4
|
+
adapter: 'postgres' | 'mysql' | 'mariadb' | 'sqlite';
|
|
5
|
+
}
|
|
6
|
+
export declare class BunDriver implements DatabaseDriver {
|
|
7
|
+
private client;
|
|
8
|
+
private adapter;
|
|
9
|
+
constructor(config: BunConfig);
|
|
10
|
+
query<T = any>(sql: string, params?: any[]): Promise<QueryResult<T>>;
|
|
11
|
+
findFirst<T = any>(table: string, where?: Record<string, any>): Promise<QueryResult<T> | null>;
|
|
12
|
+
findMany<T = any>(table: string, options?: {
|
|
13
|
+
where?: Record<string, any>;
|
|
14
|
+
limit?: number;
|
|
15
|
+
offset?: number;
|
|
16
|
+
}): Promise<QueryResult<T>>;
|
|
17
|
+
insert<T = any>(table: string, data: Record<string, any>): Promise<QueryResult<T>>;
|
|
18
|
+
update<T = any>(table: string, data: Record<string, any>, where: Record<string, any>): Promise<QueryResult<T>>;
|
|
19
|
+
delete<T = any>(table: string, where: Record<string, any>): Promise<number>;
|
|
20
|
+
close(): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface Row {
|
|
2
|
+
[key: string]: number | string | null;
|
|
3
|
+
}
|
|
4
|
+
export declare class PoubelleClient {
|
|
5
|
+
private socket;
|
|
6
|
+
private config;
|
|
7
|
+
private connected;
|
|
8
|
+
private buffer;
|
|
9
|
+
constructor(connectionString: string);
|
|
10
|
+
private parseConnectionString;
|
|
11
|
+
connect(): Promise<void>;
|
|
12
|
+
query(sql: string): Promise<Row[]>;
|
|
13
|
+
createTable(name: string, columns: Record<string, 'INT' | 'TEXT'>): Promise<void>;
|
|
14
|
+
insert(table: string, data: Record<string, number | string | null>): Promise<void>;
|
|
15
|
+
select(table: string, columns?: string[]): Promise<Row[]>;
|
|
16
|
+
close(): Promise<void>;
|
|
17
|
+
private send;
|
|
18
|
+
private waitForPrompt;
|
|
19
|
+
}
|
|
20
|
+
export default PoubelleClient;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type DatabaseDriver, type QueryResult } from '../../types';
|
|
2
|
+
interface PoubelleConfig {
|
|
3
|
+
connectionString: string;
|
|
4
|
+
}
|
|
5
|
+
export declare class PoubelleDriver implements DatabaseDriver {
|
|
6
|
+
private client;
|
|
7
|
+
constructor(config: PoubelleConfig);
|
|
8
|
+
query<T = any>(sql: string, params?: any[]): Promise<QueryResult<T>>;
|
|
9
|
+
close(): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export {};
|