@housekit/kit 0.1.32 → 0.1.33

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 +16 -1
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -8448,7 +8448,22 @@ function resolveDatabase(config, name) {
8448
8448
  const selected = pickDatabase(config, name);
8449
8449
  let url = selected.db.url;
8450
8450
  if (!url && selected.db.host) {
8451
- url = selected.db.host.startsWith("http://") || selected.db.host.startsWith("https://") ? selected.db.host : `http://${selected.db.host}`;
8451
+ let host = selected.db.host;
8452
+ if (!host.startsWith("http://") && !host.startsWith("https://")) {
8453
+ host = `http://${host}`;
8454
+ }
8455
+ if (selected.db.port) {
8456
+ try {
8457
+ const parsed = new URL(host);
8458
+ if (!parsed.port) {
8459
+ parsed.port = String(selected.db.port);
8460
+ host = parsed.toString().replace(/\/$/, "");
8461
+ }
8462
+ } catch {
8463
+ host = `${host}:${selected.db.port}`;
8464
+ }
8465
+ }
8466
+ url = host;
8452
8467
  }
8453
8468
  url = url || "http://localhost:8123";
8454
8469
  const client = createClient({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@housekit/kit",
3
- "version": "0.1.32",
3
+ "version": "0.1.33",
4
4
  "description": "CLI tool for HouseKit - manage ClickHouse schemas, migrations, and database operations with type-safe workflows.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -48,7 +48,7 @@
48
48
  },
49
49
  "dependencies": {
50
50
  "@clickhouse/client": "^1.14.0",
51
- "@housekit/orm": "^0.1.38",
51
+ "@housekit/orm": "^0.1.39",
52
52
  "boxen": "8.0.1",
53
53
  "chalk": "^5.6.2",
54
54
  "cli-table3": "^0.6.5",