@monlite/core 0.9.0 → 1.0.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/index.d.cts CHANGED
@@ -386,6 +386,8 @@ interface MonliteOptions {
386
386
  wal?: boolean;
387
387
  /** Milliseconds to wait on a locked database before erroring. Default `5000`. */
388
388
  busyTimeout?: number;
389
+ /** Allow loading SQLite extensions (required by `@monlite/vector`). Default `false`. */
390
+ allowExtensions?: boolean;
389
391
  /** Verbose logger for executed SQL (debugging). */
390
392
  verbose?: (sql: string) => void;
391
393
  }
package/dist/index.d.ts CHANGED
@@ -386,6 +386,8 @@ interface MonliteOptions {
386
386
  wal?: boolean;
387
387
  /** Milliseconds to wait on a locked database before erroring. Default `5000`. */
388
388
  busyTimeout?: number;
389
+ /** Allow loading SQLite extensions (required by `@monlite/vector`). Default `false`. */
390
+ allowExtensions?: boolean;
389
391
  /** Verbose logger for executed SQL (debugging). */
390
392
  verbose?: (sql: string) => void;
391
393
  }
package/dist/index.js CHANGED
@@ -1370,8 +1370,10 @@ var NodeSqliteDriver = class {
1370
1370
  this.verbose = options.verbose;
1371
1371
  const { DatabaseSync } = nodeSqlite;
1372
1372
  this.raw = new DatabaseSync(filename, {
1373
- readOnly: options.readonly ?? false
1373
+ readOnly: options.readonly ?? false,
1374
+ ...options.allowExtensions ? { allowExtension: true } : {}
1374
1375
  });
1376
+ if (options.allowExtensions) this.raw.enableLoadExtension(true);
1375
1377
  this.raw.exec(`PRAGMA busy_timeout = ${options.busyTimeout ?? 5e3}`);
1376
1378
  if (!options.readonly && (options.wal ?? true)) {
1377
1379
  this.raw.exec("PRAGMA journal_mode = WAL");
@@ -1895,6 +1897,7 @@ var Monlite = class {
1895
1897
  readonly: options.readonly,
1896
1898
  wal: options.wal,
1897
1899
  busyTimeout: options.busyTimeout,
1900
+ allowExtensions: options.allowExtensions,
1898
1901
  verbose: options.verbose
1899
1902
  });
1900
1903
  this.autoIndexer = new AutoIndexer(