Skip to content

Function: executePostgresGlobalRulesSource() ​

ts
function executePostgresGlobalRulesSource(
   node, 
   ctx, 
   poolFactory?
): Promise<ResolvedSourceArtifact<readonly object[]>>;

Defined in: postgres/src/executors/postgres-rules-source-executor.ts:30

Executes a PostgresRulesSourceNode (type: 'postgres:global-rules') to load ordered global rules.

Validates node.table against ^[A-Za-z_][A-Za-z0-9_]*$, queries SELECT id, directive FROM "<table>" ORDER BY id ASC, validates all rows via z.array(GlobalRuleSchema), and computes a deterministic SHA-256 hex digest.

Parameters ​

ParameterTypeDescription
nodePostgresRulesSourceNodePassive PostgreSQL global rules source AST node.
ctxResolutionContextActive source resolution context.
poolFactory?| PostgresQueryClient | PostgresPoolFactory | PoolOptional pool factory, query client, or pg.Pool.

Returns ​

Promise<ResolvedSourceArtifact<readonly object[]>>

Validated global rules and SHA-256 digest.

Released under the MIT License.