@1sat/cli 0.0.54 → 0.0.55

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1sat/cli",
3
- "version": "0.0.54",
3
+ "version": "0.0.55",
4
4
  "description": "CLI for 1Sat Ordinals SDK",
5
5
  "type": "module",
6
6
  "main": "./src/cli.ts",
@@ -167,9 +167,6 @@ function resolveStorage(
167
167
  const dataDir = ensureDataDir()
168
168
  const filename =
169
169
  messagebox.dbPath ?? join(dataDir, `messagebox-${chain}.db`)
170
- // We pass `sqlite3` to satisfy the env-driven knexfile's alias check;
171
- // the actual Client class is swapped in via ESM module mutation
172
- // just before messagebox-server is imported.
173
170
  return {
174
171
  knexClient: 'sqlite3',
175
172
  knexConnection: { filename },
@@ -177,6 +174,17 @@ function resolveStorage(
177
174
  }
178
175
 
179
176
  if (storage.provider === 'pg') {
177
+ // Prefer a dedicated messagebox database when configured (recommended:
178
+ // avoids `knex_migrations` table collisions with wallet-toolbox).
179
+ // Fall back to schema isolation against the wallet's database — note
180
+ // the `messagebox` schema must exist in that database for table
181
+ // creation to land there instead of `public`.
182
+ if (messagebox.dbUrl) {
183
+ return {
184
+ knexClient: 'pg',
185
+ knexConnection: { connectionString: messagebox.dbUrl },
186
+ }
187
+ }
180
188
  const schema = messagebox.pgSchema ?? DEFAULT_PG_SCHEMA
181
189
  return {
182
190
  knexClient: 'pg',
package/src/config.ts CHANGED
@@ -52,9 +52,15 @@ export interface ServerMessageboxConfig {
52
52
  dbPath?: string
53
53
  /**
54
54
  * Postgres schema for messagebox tables. Used only when wallet storage
55
- * is `pg`. Defaults to `messagebox`.
55
+ * is `pg` AND `dbUrl` is unset. Defaults to `messagebox`.
56
56
  */
57
57
  pgSchema?: string
58
+ /**
59
+ * Override Postgres connection URL for messagebox storage. Use this
60
+ * to point messagebox at a separate Postgres database from the wallet
61
+ * (recommended — avoids `knex_migrations` table collisions).
62
+ */
63
+ dbUrl?: string
58
64
  /**
59
65
  * Override the wallet storage URL messagebox calls for BRC-31/BRC-29
60
66
  * operations. Defaults to the local wallet server URL (`http://<host>:<port>/`).