Asqueel console example
======================

Requires Python 3.11+, SQLite 3.35+, and the matching Asqueel write-cycle
development checkout (site course snapshot: f7208dc).
Install that checkout with its migration extra before using this example.
The same version number on a different checkout is not sufficient.

Unzip this archive. From the folder containing console-demo, run:

    asqueel check ./console-demo
    asqueel db plan ./console-demo
    asqueel db apply ./console-demo
    asqueel shell ./console-demo

The database files console.db and invc.db are created in console-demo.
ASQUEEL_SQLITE_FILE can override the absolute path to console.db.

At the Python prompt:

    region = db.table('invc.region')
    region.insert({'code': 'NO', 'name': 'North'})
    db.commit()
    query = region.query(columns='$code, $name', where='$code = :code', code='NO')
    print(query.sqltext)
    rows = query.fetch()
    print([dict(row) for row in rows])
    db.rollback()

Expected rows: [{'code': 'NO', 'name': 'North'}]

Use a new code if you repeat the insert; code is a primary key.
Ctrl-D leaves the console. Pending changes are rolled back on exit.
