drizzle-kit 0.20.0-50d6b73 → 0.20.0-78ed9a3
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/drivers/index.d.ts +3 -3
- package/package.json +1 -1
- package/serializer/pgSerializer.d.ts +3 -3
- package/utils-studio.d.ts +1 -0
- package/utils-studio.js +28 -0
package/drivers/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Client } from "@libsql/client";
|
|
2
|
-
import { PgDatabase } from "drizzle-orm/pg-core";
|
|
3
|
-
import { Client as PgClient } from "pg";
|
|
1
|
+
import type { Client } from "@libsql/client";
|
|
2
|
+
import type { PgDatabase } from "drizzle-orm/pg-core";
|
|
3
|
+
import type { Client as PgClient } from "pg";
|
|
4
4
|
export declare abstract class DrizzleDbClient<T = any> {
|
|
5
5
|
protected db: T;
|
|
6
6
|
constructor(db: T);
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { AnyPgTable, PgEnum, PgSchema } from "drizzle-orm/pg-core";
|
|
2
2
|
import { Relations } from "drizzle-orm";
|
|
3
|
-
import type { IntrospectStage, IntrospectStatus } from "
|
|
4
|
-
import type { PgSchemaInternal } from "
|
|
5
|
-
import type { DrizzleDbClient } from "
|
|
3
|
+
import type { IntrospectStage, IntrospectStatus } from "../cli/views";
|
|
4
|
+
import type { PgSchemaInternal } from "../serializer/pgSchema";
|
|
5
|
+
import type { DrizzleDbClient } from "../drivers";
|
|
6
6
|
export declare const indexName: (tableName: string, columns: string[]) => string;
|
|
7
7
|
export declare const generatePgSnapshot: (tables: AnyPgTable[], enums: PgEnum<any>[], schemas: PgSchema[], schemaFilter?: string[]) => PgSchemaInternal;
|
|
8
8
|
export declare const fromDatabase: (db: DrizzleDbClient, tablesFilter: ((table: string) => boolean) | undefined, schemaFilters: string[], progressCallback?: ((stage: IntrospectStage, count: number, status: IntrospectStatus) => void) | undefined) => Promise<PgSchemaInternal>;
|
package/utils-studio.d.ts
CHANGED
|
@@ -2,3 +2,4 @@ export { toDrizzle as drizzleSchemaPg } from "./serializer/pgSerializer";
|
|
|
2
2
|
export { toDrizzle as drizzleSchemaSQLite } from "./serializer/sqliteSerializer";
|
|
3
3
|
export { sqlitePushIntrospect } from "./cli/commands/sqliteIntrospect";
|
|
4
4
|
export { pgPushIntrospect } from "./cli/commands/pgIntrospect";
|
|
5
|
+
export { DrizzleORMPgClient } from "./drivers";
|
package/utils-studio.js
CHANGED
|
@@ -2094,9 +2094,33 @@ var require_brace_expansion = __commonJS({
|
|
|
2094
2094
|
}
|
|
2095
2095
|
});
|
|
2096
2096
|
|
|
2097
|
+
// src/drivers/index.ts
|
|
2098
|
+
var import_drizzle_orm3, DrizzleDbClient, DrizzleORMPgClient;
|
|
2099
|
+
var init_drivers = __esm({
|
|
2100
|
+
"src/drivers/index.ts"() {
|
|
2101
|
+
import_drizzle_orm3 = require("drizzle-orm");
|
|
2102
|
+
DrizzleDbClient = class {
|
|
2103
|
+
constructor(db) {
|
|
2104
|
+
this.db = db;
|
|
2105
|
+
}
|
|
2106
|
+
};
|
|
2107
|
+
DrizzleORMPgClient = class extends DrizzleDbClient {
|
|
2108
|
+
async query(query, values) {
|
|
2109
|
+
const res = await this.db.execute(import_drizzle_orm3.sql.raw(query));
|
|
2110
|
+
return res.rows;
|
|
2111
|
+
}
|
|
2112
|
+
async run(query) {
|
|
2113
|
+
const res = await this.db.execute(import_drizzle_orm3.sql.raw(query));
|
|
2114
|
+
return res.rows;
|
|
2115
|
+
}
|
|
2116
|
+
};
|
|
2117
|
+
}
|
|
2118
|
+
});
|
|
2119
|
+
|
|
2097
2120
|
// src/utils-studio.ts
|
|
2098
2121
|
var utils_studio_exports = {};
|
|
2099
2122
|
__export(utils_studio_exports, {
|
|
2123
|
+
DrizzleORMPgClient: () => DrizzleORMPgClient,
|
|
2100
2124
|
drizzleSchemaPg: () => toDrizzle,
|
|
2101
2125
|
drizzleSchemaSQLite: () => toDrizzle2,
|
|
2102
2126
|
pgPushIntrospect: () => pgPushIntrospect,
|
|
@@ -3316,8 +3340,12 @@ var pgPushIntrospect = async (connection, filters, schemaFilters) => {
|
|
|
3316
3340
|
const { internal, ...schemaWithoutInternals } = schema;
|
|
3317
3341
|
return { schema: schemaWithoutInternals };
|
|
3318
3342
|
};
|
|
3343
|
+
|
|
3344
|
+
// src/utils-studio.ts
|
|
3345
|
+
init_drivers();
|
|
3319
3346
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3320
3347
|
0 && (module.exports = {
|
|
3348
|
+
DrizzleORMPgClient,
|
|
3321
3349
|
drizzleSchemaPg,
|
|
3322
3350
|
drizzleSchemaSQLite,
|
|
3323
3351
|
pgPushIntrospect,
|