Skip to main content

Module sql

Module sql 

Source
Expand description

SQL extension functors for JSE.

Following Python’s functors/sql.py pattern for demonstrating local scope. The SQL module ONLY exports $query, which creates a local environment with local operators ($pattern, $and, $*).

Constants§

QUERY_FIELDS

Functions§

pattern
Generate SQL WHERE condition for a triple pattern. This is the LOCAL version used inside $query, which expands $* to “*”.
pattern_to_triple
Convert $pattern arguments to PostgreSQL jsonb containment triple.
query
Generate SQL for multi-pattern query with LOCAL environment. Form: [$query, condition] where condition is an AST expression with local operators ($pattern, $and, $*)
sql_functors
SQL module functors - ONLY exports $query. The local operators ($pattern, $and, $*) are NOT globally available. They only exist within the local scope created by $query.
triple_to_sql_condition
Build SQL WHERE clause for a triple pattern.