Skip to content

Bintracker Database Interface

[module] bt-db

The Bintracker Database holds information concerning an existing installation of Bintracker. It is an SQLite3 database, managed through the sqlite3 extension. If Bintracker does not find bt.db on application startup, it creates and populates a fresh database.

Default Tables

mdefs

The mdefs table contains information about the installed MDAL definitions. It contains the following columns:

  • id - definition name
  • version - engine version
  • hash - MD5 hash of the .mdef file
  • platform - target platform
  • description - configuration description

The mdefs table is automatically updated during startup of Bintracker.

[procedure] (btdb-init!)

Open the Bintracker database, and point the symbol btdb to it.

[procedure] (btdb-close!)

Close the Bintracker database.

[variable] mdal-mdef-dir

default: "mdef/"

[procedure] (get-mdef-dir-subdirs)

[procedure] (btdb-get-mdef-description MDEF-ID)

[procedure] (btdb-list-mdefs #!optional (PLATFORM 'any))

Returns the list of available MDAL definitions. The returned list has the form (MDEF-ID, ENGINE-VERSION, TARGET-PLATFORM, DESCRIPTION).

[procedure] (btdb-list-platforms)

[procedure] (gather-mdef-info MDEF-ID)

Collect information on the MDAL definition named MDEF-ID into a list, which has the form (VERSION HASH TARGET-PLATFORM DESCRIPTION). Returns #f if the mdef is not found in the MDAL definition directory.

[procedure] (btdb-add-mdef! MDEF-ID)

Add the MDAL definition named MDEF-ID to the Bintracker database.

[procedure] (btdb-remove-mdef! MDEF-ID)

Remove the MDAL definition named MDEF-ID from the Bintracker database.

[procedure] (btdb-update-mdef! MDEF-ID)

Update the MDAL definition named MDEF-ID in the Bintracker database.

[procedure] (btdb-scan-mdal-mdefs!)

Scan the MDAL mdef directory, and update the Bintracker database accordingly. Definitions no longer found in the mdef directory are deleted from the database, newly found definitions are added, and entries for modified definitions are updated.

[procedure] (btdb-update!)

Update the Bintracker Database on first run of the application. Creates the mdefs table if necessary, then scans the MDAL mdef directory for new or modified definitions and adds them to the database as required.