Common Lisp Package: CL-MIGRATIONS

Database Migrations for Common Lisp

README:

FUNCTION

Public

GENERATE (NAME)

Generate an empty migration file with an assigned version number.

MIGRATE (&KEY VERSION)

Initiate migration procedure.

Undocumented

CONNECT-DB

DISCONNECT-DB

Private

CREATE-SCHEMA-TABLE

Check for schema table and create if it does not exist.

EXEC-MIGRATIONS (DB-VERSION MIG-VERSION)

Excute all the migrations within the given range in a transaction.

GET-FILE-RANGE (FROM TO)

Get the migration files within the given range, in ascending order.

GET-LATEST-MIGRATION

Get the version of latest migration available.

GET-MIGRATION-FILES

Get all files from the migrations directory, and sort them numerically.

INIT-CONFIG (&OPTIONAL CLEAN)

Load database configuration and create a connection if none exists.

INIT-CONNECTION (DB-TYPE SPEC &OPTIONAL CLEAN)

Connect to the database; Truncate database if clean flag is set.

LOAD-NECESSARY-SYSTEMS (SPEC &OPTIONAL CLEAN)

Load the matching database type

READ-SPECS (&OPTIONAL (PATH *CONFIG-PATHNAME*))

Read database and migrations directory specs and set respective variables.

SELECT-MIGRATION-FILES (DB-VERSION MIG-VERSION)

Return migration files in ascending or descending order based on whether migrating up or down respectively.

Undocumented

COMPARE-FILES (FILE1 FILE2)

DB-TYPE-SPEC (DB-TYPE SPEC)

DECF-DB-VERSION

GET-DB-VERSION

GET-MIGRATION-NUMBER (FILE)

INCF-DB-VERSION

SPEC-FN (DB-TYPE)

SLOT-ACCESSOR

Private

Undocumented

AODBC-SPEC (OBJECT)

SETFAODBC-SPEC (NEW-VALUE OBJECT)

MYSQL-SPEC (OBJECT)

SETFMYSQL-SPEC (NEW-VALUE OBJECT)

ODBC-SPEC (OBJECT)

SETFODBC-SPEC (NEW-VALUE OBJECT)

ORACLE-SPEC (OBJECT)

SETFORACLE-SPEC (NEW-VALUE OBJECT)

POSTGRESQL-SOCKET-SPEC (OBJECT)

SETFPOSTGRESQL-SOCKET-SPEC (NEW-VALUE OBJECT)

POSTGRESQL-SPEC (OBJECT)

SETFPOSTGRESQL-SPEC (NEW-VALUE OBJECT)

SQLITE-SPEC (OBJECT)

SETFSQLITE-SPEC (NEW-VALUE OBJECT)

SQLITE3-SPEC (OBJECT)

SETFSQLITE3-SPEC (NEW-VALUE OBJECT)

VARIABLE

Public

Undocumented

*CONFIG-PATHNAME*

Private

Undocumented

*MIGRATION-DIR*

*SCHEMA-TABLE-NAME*

+ALL-DB-TYPES+

CLASS

Private

CONN-SPECS

Connection specs for CLSQL for different databases