@fjall/clickhouse-migrations 0.100.0 → 0.102.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/.minified +1 -1
- package/dist/runSqlMigrations.js +2 -2
- package/package.json +3 -3
package/dist/.minified
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
9 files minified at 2026-05-
|
|
1
|
+
9 files minified at 2026-05-23T08:39:31.711Z
|
package/dist/runSqlMigrations.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{readFileSync as S,readdirSync as
|
|
2
|
-
`).some(r=>{const n=r.trim();return n.length>0&&!n.startsWith("--")})}function
|
|
1
|
+
import{readFileSync as S,readdirSync as E}from"node:fs";import{join as w}from"node:path";import{getErrorMessage as q,maskSensitiveOutput as M}from"@fjall/util";import{CLICKHOUSE_MIGRATION_SKIP_RE as y}from"@fjall/util/migration";const R=y,l=400;function b(e){return e.split(`
|
|
2
|
+
`).some(r=>{const n=r.trim();return n.length>0&&!n.startsWith("--")})}function _(e){return e.split(/;\s*\n/).map(r=>r.trim()).filter(r=>r.length>0&&b(r))}async function P(e){const{client:r,dir:n,signal:s,logger:c}=e,m=e.skipFilesMatching??R,f=E(n).filter(t=>t.endsWith(".sql")).filter(t=>!m.test(t)).sort(),a=[];for(const t of f){if(s?.aborted)throw new Error(`runSqlMigrations: aborted by signal before applying '${t}'`);const p=w(n,t),g=S(p,"utf8"),u=_(g);try{for(const o of u){if(s?.aborted)throw new Error(`runSqlMigrations: aborted by signal while applying '${t}'`);await r.command({query:o})}}catch(o){const d=q(o).replace(/'(?:[^']|'')*'/g,"'<REDACTED>'"),i=M(d),h=i.length>l?i.slice(0,l)+"\u2026":i;throw new Error(`runSqlMigrations: ${t}: ${h}`,{cause:o})}c?.info("sql migration applied",{file:t}),a.push(t)}return{applied:a}}export{b as hasSqlContent,P as runSqlMigrations};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fjall/clickhouse-migrations",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.102.0",
|
|
4
4
|
"description": "Runtime helpers for ClickHouse migration containers — user provisioning, SQL file application, connection retry. Consumes the manifest contract published by @fjall/components-infrastructure ClickHouseDatabase.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"@clickhouse/client": "^1.18.0"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@fjall/util": "^0.
|
|
47
|
+
"@fjall/util": "^0.102.0",
|
|
48
48
|
"zod": "^4.4.3"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|
|
51
51
|
"node": ">=22.0.0"
|
|
52
52
|
},
|
|
53
|
-
"gitHead": "
|
|
53
|
+
"gitHead": "04a4f13181c261cc063786eae527fa82c90a610e"
|
|
54
54
|
}
|