@easy-cms/drizzle 0.31.0 → 0.33.0

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/dist/index.js +4 -2
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1036,7 +1036,7 @@ async function connectDatabase(dialect, connection, args, options = {}) {
1036
1036
  });
1037
1037
  if (args.schema === "push") await migrator.push();
1038
1038
  else if (args.schema === "verify") await migrator.verify();
1039
- return new DrizzleDatabase(dialect, connection, schema, migrator);
1039
+ return new DrizzleDatabase(dialect, connection, schema, migrator, prefix);
1040
1040
  } catch (error) {
1041
1041
  await connection.close().catch(() => {
1042
1042
  });
@@ -1044,11 +1044,12 @@ async function connectDatabase(dialect, connection, args, options = {}) {
1044
1044
  }
1045
1045
  }
1046
1046
  var DrizzleDatabase = class {
1047
- constructor(dialect, connection, schema, migrator) {
1047
+ constructor(dialect, connection, schema, migrator, tablePrefix) {
1048
1048
  this.dialect = dialect;
1049
1049
  this.connection = connection;
1050
1050
  this.schema = schema;
1051
1051
  this.migrator = migrator;
1052
+ this.tablePrefix = tablePrefix;
1052
1053
  this.db = connection.db;
1053
1054
  for (const [slug, model] of schema.collections) {
1054
1055
  this.builders.set(
@@ -1061,6 +1062,7 @@ var DrizzleDatabase = class {
1061
1062
  connection;
1062
1063
  schema;
1063
1064
  migrator;
1065
+ tablePrefix;
1064
1066
  builders = /* @__PURE__ */ new Map();
1065
1067
  db;
1066
1068
  model(slug) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@easy-cms/drizzle",
3
- "version": "0.31.0",
3
+ "version": "0.33.0",
4
4
  "description": "Shared Drizzle ORM layer for Easy CMS database adapters",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -23,10 +23,10 @@
23
23
  "drizzle-orm": "0.45.3"
24
24
  },
25
25
  "peerDependencies": {
26
- "@easy-cms/core": "^0.31.0"
26
+ "@easy-cms/core": "^0.33.0"
27
27
  },
28
28
  "devDependencies": {
29
- "@easy-cms/core": "^0.31.0"
29
+ "@easy-cms/core": "^0.33.0"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public"