dzql 0.1.2 → 0.1.3

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": "dzql",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "PostgreSQL-powered framework with zero boilerplate CRUD operations and real-time WebSocket synchronization",
5
5
  "type": "module",
6
6
  "main": "src/server/index.js",
@@ -20,13 +20,12 @@
20
20
  ],
21
21
  "scripts": {
22
22
  "test": "bun test",
23
- "prepublishOnly": "echo '✅ Publishing DZQL v0.1.2...'"
23
+ "prepublishOnly": "echo '✅ Publishing DZQL v0.1.3...'"
24
24
  },
25
25
  "dependencies": {
26
26
  "jose": "^6.1.0",
27
27
  "postgres": "^3.4.7"
28
28
  },
29
-
30
29
  "keywords": [
31
30
  "postgresql",
32
31
  "postgres",
@@ -345,14 +345,6 @@ BEGIN
345
345
  p_entity);
346
346
  EXECUTE l_sql_stmt INTO l_result;
347
347
 
348
- -- Execute graph rules for update
349
- l_graph_rules_result := dzql.execute_graph_rules(
350
- p_entity,
351
- 'update',
352
- l_existing_record,
353
- l_result,
354
- p_user_id
355
- );
356
348
 
357
349
  ELSE
358
350
  -- INSERT: Use provided values, let database handle defaults
@@ -387,14 +379,6 @@ BEGIN
387
379
  p_entity);
388
380
  EXECUTE l_sql_stmt INTO l_result;
389
381
 
390
- -- Execute graph rules for insert
391
- l_graph_rules_result := dzql.execute_graph_rules(
392
- p_entity,
393
- 'insert',
394
- NULL,
395
- l_result,
396
- p_user_id
397
- );
398
382
  END IF;
399
383
 
400
384
  -- Execute graph rules for the appropriate operation
@@ -342,6 +342,13 @@ BEGIN
342
342
  END IF;
343
343
  END IF;
344
344
 
345
+ -- Add permission check to WHERE clause
346
+ IF l_where_clause = '' OR l_where_clause = 'WHERE' THEN
347
+ l_where_clause := format('WHERE dzql.check_permission(%L, ''view'', %L, to_jsonb(t.*))', p_user_id, p_entity);
348
+ ELSE
349
+ l_where_clause := l_where_clause || format(' AND dzql.check_permission(%L, ''view'', %L, to_jsonb(t.*))', p_user_id, p_entity);
350
+ END IF;
351
+
345
352
  -- Build base SQL
346
353
  l_base_sql := format('FROM %I t %s', p_entity, l_where_clause);
347
354