Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the sxql-composer Reference Manual, version 0.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 15:09:57 2020 GMT+0.
• Introduction | What sxql-composer is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
Build and compose SXQL queries dynamically.
It is not possible to dynamically build and compose SXQL queries because it uses macros for query building. For example, something like:
(defun build-query (fields &key order-by)
(select fields
(where (:= 'user.id 1))
(when order-by
(order-by order-by))))
is not possible.
SXQL-COMPOSER implements an equivalent set of functions in order to be able to either build new queries dynamically, or modify and composer already existent queries.
With SXQL-COMPOSER:
(defun build-query (fields &key order-by)
(let ((q (select fields
(where (:= 'user.id 1)))))
(when order-by (order-by= q order-by))
q))
Also, it is not possible to modify already existent queries. That is useful for filtering:
(defun all-users ()
(select :* (from :users)))
(defun married-users ()
(and-where (all-users)
'(:= status "married")))
CL-ARROWS library is potentially useful for building the queries:
(defun married-users ()
(-> (all-users)
(and-where '(:= status "married"))))
(statement expression)
Add an AND clause to the WHERE clause of SQL STATEMENT
(statement &rest fields)
Add FIELDS to the SELECT SQL STATEMENT
(statement fields)
Set the FIELDS of the SELECT SQL STATEMENT
(statement &rest tables)
Add TABLES to the FROM clause of the SQL STATEMENT
(statement &rest tables)
Set the FROM clause of the SQL STATEMENT
(statement &rest expressions)
Add expressions to the GROUP BY clause of the SQL STATEMENT
(statement &rest expressions)
Set the GROUP BY clause of the SQL statement
(statement count1 &optional count2)
Set the LIMIT clause of the SQL STATEMENT
(statement offset)
Set the OFFSET clause of the SQL STATEMENT
(statement expression)
Add an OR clause to the WHERE clause of SQL STATEMENT
(statement &rest expressions)
Add EXPRESSIONS ot the ORDER BY clause of the SQL STATEMENT
(statement &rest expressions)
Set the ORDER BY clause of the SQL STATEMENT
(statement expression)
Set the RETURNING clause of SQL STATEMENT
(statement expression)
Set SQL WHERE clause of the SQL STATEMENT
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The sxql-composer system |
Mariano Montone <marianomontone@gmail.com>
MIT
Build and compose SXQL queries dynamically
0.1
sxql
sxql-composer.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The sxql-composer.asd file | ||
• The sxql-composer/package.lisp file | ||
• The sxql-composer/sxql-composer.lisp file |
Next: The sxql-composer/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
sxql-composer.asd
sxql-composer (system)
Next: The sxql-composer/sxql-composer․lisp file, Previous: The sxql-composer․asd file, Up: Lisp files [Contents][Index]
sxql-composer (system)
package.lisp
Previous: The sxql-composer/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
sxql-composer (system)
sxql-composer.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The sxql-composer package |
Dynamic SXQL query composition
package.lisp (file)
common-lisp
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported functions |
Previous: Exported definitions, Up: Exported definitions [Contents][Index]
Add an AND clause to the WHERE clause of SQL STATEMENT
sxql-composer.lisp (file)
Add FIELDS to the SELECT SQL STATEMENT
sxql-composer.lisp (file)
Set the FIELDS of the SELECT SQL STATEMENT
sxql-composer.lisp (file)
Add TABLES to the FROM clause of the SQL STATEMENT
sxql-composer.lisp (file)
Set the FROM clause of the SQL STATEMENT
sxql-composer.lisp (file)
Add expressions to the GROUP BY clause of the SQL STATEMENT
sxql-composer.lisp (file)
Set the GROUP BY clause of the SQL statement
sxql-composer.lisp (file)
Set the LIMIT clause of the SQL STATEMENT
sxql-composer.lisp (file)
Set the OFFSET clause of the SQL STATEMENT
sxql-composer.lisp (file)
Add an OR clause to the WHERE clause of SQL STATEMENT
sxql-composer.lisp (file)
Add EXPRESSIONS ot the ORDER BY clause of the SQL STATEMENT
sxql-composer.lisp (file)
Set the ORDER BY clause of the SQL STATEMENT
sxql-composer.lisp (file)
Set the RETURNING clause of SQL STATEMENT
sxql-composer.lisp (file)
Set SQL WHERE clause of the SQL STATEMENT
sxql-composer.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal functions |
Previous: Internal definitions, Up: Internal definitions [Contents][Index]
sxql-composer.lisp (file)
sxql-composer.lisp (file)
sxql-composer.lisp (file)
sxql-composer.lisp (file)
sxql-composer.lisp (file)
sxql-composer.lisp (file)
sxql-composer.lisp (file)
sxql-composer.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | F L S |
---|
Jump to: | F L S |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | A E F G L O R S W |
---|
Jump to: | A E F G L O R S W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | P S |
---|
Jump to: | P S |
---|