@plyaz/db 0.2.0 → 0.3.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.
- package/dist/cli/index.js +39 -9
- package/dist/cli/index.js.map +1 -1
- package/dist/index.cjs +24 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +24 -3
- package/dist/index.mjs.map +1 -1
- package/dist/migrations/MigrationManager.d.ts.map +1 -1
- package/dist/repository/BaseRepository.d.ts +9 -0
- package/dist/repository/BaseRepository.d.ts.map +1 -1
- package/dist/seeds/SeedManager.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -7215,6 +7215,17 @@ var BaseRepository = class {
|
|
|
7215
7215
|
__name(this, "BaseRepository");
|
|
7216
7216
|
}
|
|
7217
7217
|
defaultConfig;
|
|
7218
|
+
/**
|
|
7219
|
+
* Get the table name for this repository
|
|
7220
|
+
*
|
|
7221
|
+
* Useful for transaction operations where you need the table name
|
|
7222
|
+
* to execute raw queries within a transaction context.
|
|
7223
|
+
*
|
|
7224
|
+
* @returns The table name this repository operates on
|
|
7225
|
+
*/
|
|
7226
|
+
getTableName() {
|
|
7227
|
+
return this.tableName;
|
|
7228
|
+
}
|
|
7218
7229
|
/**
|
|
7219
7230
|
* Merges default repository config with per-operation config
|
|
7220
7231
|
* Per-operation config takes precedence over default config
|
|
@@ -10599,7 +10610,11 @@ var MigrationManager = class {
|
|
|
10599
10610
|
const isEmptyOrComment = trimmedLine === "" || trimmedLine.startsWith("--");
|
|
10600
10611
|
current += line + "\n";
|
|
10601
10612
|
if (isEmptyOrComment) continue;
|
|
10602
|
-
const dollarState = this.processDollarDelimiters(
|
|
10613
|
+
const dollarState = this.processDollarDelimiters(
|
|
10614
|
+
line,
|
|
10615
|
+
inDollarBlock,
|
|
10616
|
+
dollarTag
|
|
10617
|
+
);
|
|
10603
10618
|
inDollarBlock = dollarState.inDollarBlock;
|
|
10604
10619
|
dollarTag = dollarState.dollarTag;
|
|
10605
10620
|
const isEndOfStatement = !inDollarBlock && trimmedLine.endsWith(";");
|
|
@@ -10650,7 +10665,9 @@ var MigrationManager = class {
|
|
|
10650
10665
|
await adapter.query(statement);
|
|
10651
10666
|
const isInterval = (i + 1) % PROGRESS_LOG_INTERVAL === 0;
|
|
10652
10667
|
const isLast = i === total - 1;
|
|
10653
|
-
const isSignificant = Boolean(
|
|
10668
|
+
const isSignificant = Boolean(
|
|
10669
|
+
description.match(/^(CREATE TABLE|CREATE FUNCTION|CREATE TRIGGER)/i)
|
|
10670
|
+
);
|
|
10654
10671
|
if (isInterval || isLast || isSignificant) {
|
|
10655
10672
|
console.log(` ✓ [${i + 1}/${total}] ${description}`);
|
|
10656
10673
|
}
|
|
@@ -11073,7 +11090,11 @@ var SeedManager = class {
|
|
|
11073
11090
|
const isEmptyOrComment = trimmedLine === "" || trimmedLine.startsWith("--");
|
|
11074
11091
|
current += line + "\n";
|
|
11075
11092
|
if (isEmptyOrComment) continue;
|
|
11076
|
-
const dollarState = this.processDollarDelimiters(
|
|
11093
|
+
const dollarState = this.processDollarDelimiters(
|
|
11094
|
+
line,
|
|
11095
|
+
inDollarBlock,
|
|
11096
|
+
dollarTag
|
|
11097
|
+
);
|
|
11077
11098
|
inDollarBlock = dollarState.inDollarBlock;
|
|
11078
11099
|
dollarTag = dollarState.dollarTag;
|
|
11079
11100
|
if (!inDollarBlock && trimmedLine.endsWith(";") && current.trim()) {
|