On this page:
2.1 DBMS independent code
2.2 DBMS specific code
2.2.1 SQLite
2.2.2 Postgre SQL
2.3 Audit trail code
Version: 4.1.0.4

2 Snooze modules

The majority of Snooze is provided in two parts: a DBMS independent part provided by "snooze.ss" and a DBMS specific part provided by a separate module such as "sqlite3/sqlite3.ss".

2.1 DBMS independent code

Require the following module for the DBMS independent part of Snooze:

 (require (planet untyped/snooze:2))

Compatible with the scheme and scheme/base languages.

We recommend you require and re-provide this interface from a single module in your application. For example:

  #lang scheme/base

  (require (planet untyped/snooze:2))

  (provide (all-from-out (planet untyped/snooze:2)))

2.2 DBMS specific code

Snooze currently supports the DBMS back-ends listed below, although support for more back-ends is forthcoming. Choose one of the following modules depending on which back-end you are using:

2.2.1 SQLite

 (require (planet untyped/snooze:2/sqlite3/sqlite3))

SQLite 3.x specific definitions. This module uses Jay McCarthy’s sqlite.plt package to create database connections.

You must make sure your SQLite installation is compiled with thread safety enabled if you wish to access a single database from multiple concurrent Scheme threads.

2.2.2 PostgreSQL

 (require (planet untyped/snooze:2/postgresql8/postgresql8))

PostgreSQL 8.x specific definitions. This module uses Ryan Culpepper’s spgsql.plt package to create database connections.

You must make sure your PostgreSQL installation has a "pg_hba.conf" file that allows TCP/IP connections from appropriate client machines (localhost will normally suffice).

2.3 Audit trail code

This feature should be considered experimental: it may be removed or changed in the future.

Snooze has an audit trail feature that can be used to log and roll back changes to a database. Require it form the following module:

 (require (planet untyped/snooze:2/audit/audit))

Compatible with the scheme and scheme/base languages. See the module source code for documentation.