From 274c4cc42c5451fd073f577bf1592aed091dacf7 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Mon, 27 Mar 2023 22:48:57 +0300 Subject: Allow running raw queries in field form Signed-off-by: Munyoki Kilyungi --- dump.scm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'dump.scm') diff --git a/dump.scm b/dump.scm index 112086b..b05af85 100755 --- a/dump.scm +++ b/dump.scm @@ -134,6 +134,7 @@ association list mapping substrings to their replacements." #`(key #,(symbol->string (syntax->datum ((syntax-rules (field) + ((field (query alias)) alias) ((field table column) column) ((field table column alias) alias) ((field table column operation alias) alias)) @@ -149,6 +150,7 @@ ALIST field-name) forms." #,(symbol->string (syntax->datum ((syntax-rules (field) + ((field (query alias)) alias) ((field table column) column) ((field table column alias) alias) ((field table column operation alias) alias)) @@ -311,7 +313,10 @@ must be remedied." ((table-name column-name _ ...) (datum->syntax x (column-id (symbol->string table-name) - (symbol->string column-name)))))) + (symbol->string column-name)))) + (((query alias)) + (datum->syntax + x (column-id query (symbol->string alias)))))) (collect-fields predicate-clause)))) #,(dump-id dump-table (syntax->datum #'predicate))) ;; Automatically create domain triples -- cgit v1.2.3