@postnesia/db 0.1.0 → 0.1.1

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.js CHANGED
@@ -3,13 +3,11 @@
3
3
  * No ORM, just raw SQL - fast and simple
4
4
  */
5
5
  import 'dotenv/config';
6
- import { join, dirname } from 'node:path';
7
6
  import { fileURLToPath } from 'node:url';
8
7
  import Database from 'better-sqlite3';
9
8
  import * as sqliteVec from 'sqlite-vec';
10
9
  import { EMBEDDING_DIMENSIONS } from './embeddings.js';
11
- const __dirname = dirname(fileURLToPath(import.meta.url));
12
- const DB_PATH = join(__dirname, '../memory.db');
10
+ const DB_PATH = fileURLToPath(process.env.DATABASE_URL);
13
11
  // Singleton connection
14
12
  let dbInstance = null;
15
13
  export function getDb(readonly = false) {
package/dist/migrate.js CHANGED
@@ -18,8 +18,8 @@ import { randomUUID } from 'node:crypto';
18
18
  import Database from 'better-sqlite3';
19
19
  import * as sqliteVec from 'sqlite-vec';
20
20
  const __dirname = dirname(fileURLToPath(import.meta.url));
21
- const DB_PATH = join(__dirname, '../memory.db');
22
21
  const MIGRATIONS_DIR = join(__dirname, '../prisma/migrations');
22
+ const DB_PATH = fileURLToPath(process.env.DATABASE_URL);
23
23
  // -------------------------------------------------------------------
24
24
  // Open DB with sqlite-vec loaded (mirrors getDb() setup)
25
25
  // -------------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@postnesia/db",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "AI Agent memory context database",
5
5
  "type": "module",
6
6
  "private": false,