graphile-sql-expression-validator 0.2.1 → 0.2.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/README.md CHANGED
@@ -15,7 +15,7 @@ npm install graphile-sql-expression-validator
15
15
  Tag columns that contain SQL expressions with `@sqlExpression`:
16
16
 
17
17
  ```sql
18
- COMMENT ON COLUMN collections_public.field.default_value IS E'@sqlExpression';
18
+ COMMENT ON COLUMN metaschema_public.field.default_value IS E'@sqlExpression';
19
19
  ```
20
20
 
21
21
  The plugin will automatically look for a companion `*_ast` column (e.g., `default_value_ast`) to store the parsed AST.
@@ -26,7 +26,7 @@ By default, the plugin looks for a companion column named `<column>_ast`. You ca
26
26
 
27
27
  ```sql
28
28
  -- Use a custom AST column name
29
- COMMENT ON COLUMN collections_public.field.default_value IS E'@sqlExpression\n@rawSqlAstField my_custom_ast_column';
29
+ COMMENT ON COLUMN metaschema_public.field.default_value IS E'@sqlExpression\n@rawSqlAstField my_custom_ast_column';
30
30
  ```
31
31
 
32
32
  If `@rawSqlAstField` points to a non-existent column, the plugin will throw an error. If not specified, it falls back to the `<column>_ast` convention (and silently skips AST storage if that column doesn't exist).
@@ -47,7 +47,7 @@ const postgraphileOptions = {
47
47
  // Optional: Maximum expression length (default: 10000)
48
48
  maxExpressionLength: 5000,
49
49
  // Optional: Auto-allow schemas owned by the current database
50
- // Queries: SELECT schema_name FROM collections_public.schema
50
+ // Queries: SELECT schema_name FROM metaschema_public.schema
51
51
  // WHERE database_id = jwt_private.current_database_id()
52
52
  allowOwnedSchemas: true,
53
53
  // Optional: Custom hook for dynamic schema resolution
package/esm/index.js CHANGED
@@ -199,7 +199,7 @@ async function resolveEffectiveOptions(baseOptions, gqlContext) {
199
199
  let ownedSchemas = gqlContext[OWNED_SCHEMAS_CACHE_KEY];
200
200
  if (!ownedSchemas) {
201
201
  try {
202
- const result = await gqlContext.pgClient.query(`SELECT schema_name FROM collections_public.schema WHERE database_id = jwt_private.current_database_id()`);
202
+ const result = await gqlContext.pgClient.query(`SELECT schema_name FROM metaschema_public.schema WHERE database_id = jwt_private.current_database_id()`);
203
203
  ownedSchemas = result.rows.map((row) => row.schema_name);
204
204
  gqlContext[OWNED_SCHEMAS_CACHE_KEY] = ownedSchemas;
205
205
  }
package/index.js CHANGED
@@ -203,7 +203,7 @@ async function resolveEffectiveOptions(baseOptions, gqlContext) {
203
203
  let ownedSchemas = gqlContext[OWNED_SCHEMAS_CACHE_KEY];
204
204
  if (!ownedSchemas) {
205
205
  try {
206
- const result = await gqlContext.pgClient.query(`SELECT schema_name FROM collections_public.schema WHERE database_id = jwt_private.current_database_id()`);
206
+ const result = await gqlContext.pgClient.query(`SELECT schema_name FROM metaschema_public.schema WHERE database_id = jwt_private.current_database_id()`);
207
207
  ownedSchemas = result.rows.map((row) => row.schema_name);
208
208
  gqlContext[OWNED_SCHEMAS_CACHE_KEY] = ownedSchemas;
209
209
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "graphile-sql-expression-validator",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Graphile plugin for SQL expression validation and AST normalization",
5
5
  "author": "Constructive <developers@constructive.io>",
6
6
  "homepage": "https://github.com/constructive-io/constructive",
@@ -51,5 +51,5 @@
51
51
  "pgsql-deparser": "^17.17.0",
52
52
  "pgsql-parser": "^17.9.9"
53
53
  },
54
- "gitHead": "f2f9c9851beff3214790dfca371e4ca7f6c1373f"
54
+ "gitHead": "baa2f7598cde3baf3f05f161a11bafa12c66f6aa"
55
55
  }