graphile-llm 1.20.0 → 1.20.2

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/config-cache.js CHANGED
@@ -66,6 +66,12 @@ const billingCache = new graphile_cache_1.ModuleConfigCache({
66
66
  const SCHEMA_EXISTS_SQL = `
67
67
  SELECT 1 FROM information_schema.schemata WHERE schema_name = $1 LIMIT 1
68
68
  `;
69
+ /**
70
+ * The module table is absent on a database that never provisioned it; only
71
+ * that undefined_table probe result means "not configured". Anything else
72
+ * (permissions, connectivity, bad SQL) is a real failure and propagates.
73
+ */
74
+ const isModuleTableMissing = (err) => err?.code === '42P01';
69
75
  async function resolveInferenceLogConfig(pgClient, databaseId) {
70
76
  try {
71
77
  const schemaCheck = await pgClient.query(SCHEMA_EXISTS_SQL, ['metaschema_modules_public']);
@@ -80,8 +86,10 @@ async function resolveInferenceLogConfig(pgClient, databaseId) {
80
86
  tableName: row.table_name
81
87
  };
82
88
  }
83
- catch {
84
- return null;
89
+ catch (err) {
90
+ if (isModuleTableMissing(err))
91
+ return null;
92
+ throw err;
85
93
  }
86
94
  }
87
95
  async function resolveBillingConfig(pgClient, databaseId) {
@@ -104,9 +112,10 @@ async function resolveBillingConfig(pgClient, databaseId) {
104
112
  checkBillingQuotaFunction: 'check_billing_quota'
105
113
  };
106
114
  }
107
- catch {
108
- // Schema/table doesn't exist or query failed — billing not available
109
- return null;
115
+ catch (err) {
116
+ if (isModuleTableMissing(err))
117
+ return null;
118
+ throw err;
110
119
  }
111
120
  }
112
121
  // ─── Public API ─────────────────────────────────────────────────────────────
@@ -61,6 +61,12 @@ const billingCache = new ModuleConfigCache({
61
61
  const SCHEMA_EXISTS_SQL = `
62
62
  SELECT 1 FROM information_schema.schemata WHERE schema_name = $1 LIMIT 1
63
63
  `;
64
+ /**
65
+ * The module table is absent on a database that never provisioned it; only
66
+ * that undefined_table probe result means "not configured". Anything else
67
+ * (permissions, connectivity, bad SQL) is a real failure and propagates.
68
+ */
69
+ const isModuleTableMissing = (err) => err?.code === '42P01';
64
70
  async function resolveInferenceLogConfig(pgClient, databaseId) {
65
71
  try {
66
72
  const schemaCheck = await pgClient.query(SCHEMA_EXISTS_SQL, ['metaschema_modules_public']);
@@ -75,8 +81,10 @@ async function resolveInferenceLogConfig(pgClient, databaseId) {
75
81
  tableName: row.table_name
76
82
  };
77
83
  }
78
- catch {
79
- return null;
84
+ catch (err) {
85
+ if (isModuleTableMissing(err))
86
+ return null;
87
+ throw err;
80
88
  }
81
89
  }
82
90
  async function resolveBillingConfig(pgClient, databaseId) {
@@ -99,9 +107,10 @@ async function resolveBillingConfig(pgClient, databaseId) {
99
107
  checkBillingQuotaFunction: 'check_billing_quota'
100
108
  };
101
109
  }
102
- catch {
103
- // Schema/table doesn't exist or query failed — billing not available
104
- return null;
110
+ catch (err) {
111
+ if (isModuleTableMissing(err))
112
+ return null;
113
+ throw err;
105
114
  }
106
115
  }
107
116
  // ─── Public API ─────────────────────────────────────────────────────────────
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphile-llm",
3
- "version": "1.20.0",
3
+ "version": "1.20.2",
4
4
  "description": "LLM integration plugin for PostGraphile v5 — server-side text-to-vector embedding and text companion fields for pgvector columns",
5
5
  "author": "Constructive <developers@constructive.io>",
6
6
  "homepage": "https://github.com/constructive-io/constructive",
@@ -30,9 +30,9 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@agentic-kit/ollama": "2.16.0",
33
- "@constructive-io/express-context": "^0.35.0",
33
+ "@constructive-io/express-context": "^0.35.1",
34
34
  "@constructive-io/llm-env": "^0.16.0",
35
- "graphile-cache": "^4.16.0"
35
+ "graphile-cache": "^4.16.1"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@dataplan/pg": "^1.1.1",
@@ -56,11 +56,11 @@
56
56
  },
57
57
  "devDependencies": {
58
58
  "@types/node": "^22.19.11",
59
- "graphile-connection-filter": "^2.18.0",
60
- "graphile-search": "^2.18.0",
61
- "graphile-test": "^5.18.0",
59
+ "graphile-connection-filter": "^2.18.2",
60
+ "graphile-search": "^2.18.2",
61
+ "graphile-test": "^5.18.2",
62
62
  "makage": "^0.8.0",
63
- "pgsql-test": "^5.18.0"
63
+ "pgsql-test": "^5.18.1"
64
64
  },
65
65
  "keywords": [
66
66
  "postgraphile",
@@ -75,5 +75,5 @@
75
75
  "ollama",
76
76
  "openai"
77
77
  ],
78
- "gitHead": "487c4ec9ee997d7da80584a3d41d7120d4354c54"
78
+ "gitHead": "0b4ffa11a6d7958ba1068ce8e19616d4b018c0d6"
79
79
  }