driftsql 1.0.14 → 1.0.16

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/dist/index.d.mts CHANGED
@@ -22,6 +22,17 @@ interface PreparedStatement {
22
22
  execute<T = any>(params?: any[]): Promise<QueryResult<T>>;
23
23
  finalize(): Promise<void>;
24
24
  }
25
+ declare class DatabaseError extends Error {
26
+ readonly driverType: string;
27
+ readonly originalError?: Error | undefined;
28
+ constructor(message: string, driverType: string, originalError?: Error | undefined);
29
+ }
30
+ declare class QueryError extends DatabaseError {
31
+ constructor(driverType: string, sql: string, originalError?: Error);
32
+ }
33
+ declare class ConnectionError extends DatabaseError {
34
+ constructor(driverType: string, originalError?: Error);
35
+ }
25
36
 
26
37
  interface PostgresConfig {
27
38
  connectionString?: string;
@@ -156,5 +167,5 @@ declare function createSqliteClient<DT = any>(config: {
156
167
  }): SQLClient<DT>;
157
168
  declare const DriftSQLClient: typeof SQLClient;
158
169
 
159
- export { DriftSQLClient, LibSQLDriver, MySQLDriver, PostgresDriver, SQLClient, SqliteDriver, createLibSQLClient, createMySQLClient, createPostgresClient, createSqliteClient, inspectDB, inspectLibSQL, inspectMySQL, inspectPostgres, inspectSQLite };
160
- export type { ClientOptions, DatabaseDriver, QueryResult };
170
+ export { ConnectionError, DriftSQLClient, LibSQLDriver, MySQLDriver, PostgresDriver, QueryError, SQLClient, SqliteDriver, createLibSQLClient, createMySQLClient, createPostgresClient, createSqliteClient, inspectDB, inspectLibSQL, inspectMySQL, inspectPostgres, inspectSQLite };
171
+ export type { ClientOptions, DatabaseDriver, QueryField, QueryResult };
package/dist/index.d.ts CHANGED
@@ -22,6 +22,17 @@ interface PreparedStatement {
22
22
  execute<T = any>(params?: any[]): Promise<QueryResult<T>>;
23
23
  finalize(): Promise<void>;
24
24
  }
25
+ declare class DatabaseError extends Error {
26
+ readonly driverType: string;
27
+ readonly originalError?: Error | undefined;
28
+ constructor(message: string, driverType: string, originalError?: Error | undefined);
29
+ }
30
+ declare class QueryError extends DatabaseError {
31
+ constructor(driverType: string, sql: string, originalError?: Error);
32
+ }
33
+ declare class ConnectionError extends DatabaseError {
34
+ constructor(driverType: string, originalError?: Error);
35
+ }
25
36
 
26
37
  interface PostgresConfig {
27
38
  connectionString?: string;
@@ -156,5 +167,5 @@ declare function createSqliteClient<DT = any>(config: {
156
167
  }): SQLClient<DT>;
157
168
  declare const DriftSQLClient: typeof SQLClient;
158
169
 
159
- export { DriftSQLClient, LibSQLDriver, MySQLDriver, PostgresDriver, SQLClient, SqliteDriver, createLibSQLClient, createMySQLClient, createPostgresClient, createSqliteClient, inspectDB, inspectLibSQL, inspectMySQL, inspectPostgres, inspectSQLite };
160
- export type { ClientOptions, DatabaseDriver, QueryResult };
170
+ export { ConnectionError, DriftSQLClient, LibSQLDriver, MySQLDriver, PostgresDriver, QueryError, SQLClient, SqliteDriver, createLibSQLClient, createMySQLClient, createPostgresClient, createSqliteClient, inspectDB, inspectLibSQL, inspectMySQL, inspectPostgres, inspectSQLite };
171
+ export type { ClientOptions, DatabaseDriver, QueryField, QueryResult };
package/dist/index.mjs CHANGED
@@ -715,20 +715,16 @@ class SQLClient {
715
715
  }
716
716
  }
717
717
  function createPostgresClient(config) {
718
- const { PostgresDriver: PostgresDriver2 } = require("./drivers/postgres");
719
- return new SQLClient({ driver: new PostgresDriver2(config) });
718
+ return new SQLClient({ driver: new PostgresDriver(config) });
720
719
  }
721
720
  function createLibSQLClient(config) {
722
- const { LibSQLDriver: LibSQLDriver2 } = require("./drivers/libsql");
723
- return new SQLClient({ driver: new LibSQLDriver2(config) });
721
+ return new SQLClient({ driver: new LibSQLDriver(config) });
724
722
  }
725
723
  function createMySQLClient(config) {
726
- const { MySQLDriver: MySQLDriver2 } = require("./drivers/mysql");
727
- return new SQLClient({ driver: new MySQLDriver2(config) });
724
+ return new SQLClient({ driver: new MySQLDriver(config) });
728
725
  }
729
726
  function createSqliteClient(config) {
730
- const { SqliteDriver: SqliteDriver2 } = require("./drivers/sqlite");
731
- return new SQLClient({ driver: new SqliteDriver2(config) });
727
+ return new SQLClient({ driver: new SqliteDriver(config) });
732
728
  }
733
729
  const DriftSQLClient = SQLClient;
734
730
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "driftsql",
3
- "version": "1.0.14",
3
+ "version": "1.0.16",
4
4
  "author": "lasse vestergaard",
5
5
  "description": "A lightweight SQL client for TypeScript",
6
6
  "repository": "lassejlv/driftsql",