drizzle-kit 0.16.4 → 0.16.5

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.
Files changed (2) hide show
  1. package/index.js +10 -8
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -12817,7 +12817,7 @@ var init_pgSerializer = __esm({
12817
12817
  fromDatabase = async (db, progressCallback) => {
12818
12818
  const result = {};
12819
12819
  const allTables = await db.query(
12820
- `SELECT table_schema, table_name FROM information_schema.tables WHERE table_schema != 'pg_catalog' and table_schema != 'information_schema';`
12820
+ `SELECT table_schema, table_name FROM information_schema.tables WHERE table_schema = 'public';`
12821
12821
  );
12822
12822
  const schemas = new Set(allTables.rows.map((it) => it.table_schema));
12823
12823
  progressCallback("tables", allTables.rows.length, "done");
@@ -25937,9 +25937,11 @@ var init_introspect = __esm({
25937
25937
  relations.add(relation);
25938
25938
  });
25939
25939
  });
25940
- const schemas = Object.fromEntries(Object.entries(schema4.schemas).map((it) => {
25941
- return [it[0], it[1].camelCase()];
25942
- }));
25940
+ const schemas = Object.fromEntries(
25941
+ Object.entries(schema4.schemas).map((it) => {
25942
+ return [it[0], it[1].camelCase()];
25943
+ })
25944
+ );
25943
25945
  const enumTypes = new Set(Object.values(schema4.enums).map((it) => it.name));
25944
25946
  const imports = Object.values(schema4.tables).reduce(
25945
25947
  (res, it) => {
@@ -25968,13 +25970,13 @@ var init_introspect = __esm({
25968
25970
  return `export const ${it.name.camelCase()} = pgEnum("${it.name}", [${values}])
25969
25971
  `;
25970
25972
  }).join("").concat("\n");
25971
- const schemaStatements = Object.entries(schemas).map((it) => {
25973
+ const schemaStatements = Object.entries(schemas).filter((it) => it[0] !== "public").map((it) => {
25972
25974
  return `export const ${it[1]} = pgSchema("${it[0]}");
25973
25975
  `;
25974
25976
  }).join();
25975
25977
  const tableStatements = Object.values(schema4.tables).map((table4) => {
25976
- var _a;
25977
- const func = (_a = schemas[table4.schema]) != null ? _a : "pgTable";
25978
+ const schema5 = schemas[table4.schema];
25979
+ const func = schema5 || schema5 === "public" ? "pgTable" : schema5;
25978
25980
  let statement = `export const ${table4.name.camelCase()} = ${func}("${table4.name}", {
25979
25981
  `;
25980
25982
  statement += createTableColumns(
@@ -26381,7 +26383,7 @@ init_source();
26381
26383
  // package.json
26382
26384
  var package_default = {
26383
26385
  name: "drizzle-kit",
26384
- version: "0.16.4",
26386
+ version: "0.16.5",
26385
26387
  repository: "https://github.com/drizzle-team/drizzle-kit-mirror",
26386
26388
  author: "Alex Blokh <aleksandrblokh@gmail.com>",
26387
26389
  license: "MIT",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drizzle-kit",
3
- "version": "0.16.4",
3
+ "version": "0.16.5",
4
4
  "repository": "https://github.com/drizzle-team/drizzle-kit-mirror",
5
5
  "author": "Alex Blokh <aleksandrblokh@gmail.com>",
6
6
  "license": "MIT",