Version: v0.5.1 - Beta.  We welcome contributors & feedback.  THanks!


Databases are configured in settings/app.jcon.

Entries with a file key will point to a sqlite file in data/db.

    app: {
        // ...

    databases: {

        // default sqlite database
        default: {
            file: app.db  // sqlite

        // exampe of a mysql database
        another: {
            driver: 'mysql',  // or 'pgsql'
            server: 'localhost',
            database: 'example',
            username: 'dbuser',
            password: '12345'

All functions use the default database. To point to another database, call Db.use (see below).

THT will automatically connect to each database as needed, and disconnect when the current request ends.

NOTE: Db operations are not callable within templates, in order to keep view-level code separate from app logic.