Next: , Previous: Rolling Your Own, Up: Top


8 Non-portable Extensions to Iterate (Contribs)

Currently, there is only one non-portable extension to iterate in the distribution: iterate-pg. If you have made an extension that depends on non-portable features, feel free to send them to asf@boinkor.net for inclusion in the iterate distribution.

8.1 An SQL query driver for iterate

The pg package by Eric Marsden (see http://cliki.net/pg) provides an interface to the PostgreSQL database. Using the iterpg extension, it is possible to handle the results of SQL queries using iter.

This usage example should give you an idea of how to use it:

  (pg:with-pg-connection (c "somedb" "someuser")
    (iter (for (impl version date) in-relation "select * from version"
                                   on-connection *dbconn*)
          (collect version)))

To use the extension via ASDF, simply make your system depend on the iterate-pg system instead of the iterate system. To load it manually, use:

  (asdf:oos 'asdf:load-op :iterate-pg)