Next: , Previous: , Up: The (database postgres*) Modules   [Contents][Index]


9 Query Construction

Constructing a typical SQL SELECT query (to be passed to pg-exec) can be tedious and error prone due to the many string-munging operations involved. Guile-PG provides some procedures to make things a little easier.

To get started, load the postgres-qcons module:

(use-modules (database postgres-qcons))

This provides procedures to render prefix-style expressions to SQL syntax, essentially by constructing stylized trees (nested lists) and then flattening them to a string on output.