Reporting on a Database with info
kent info reports what an existing Cordelia database contains: its schema
version, the schema version this build of Kent expects, and the row count of every table
that holds at least one row.
It is read-only, and writes nothing to the database it opens.
Synopsis
kent info <dbfilename>
Only populated tables are listed
A Cordelia database has around 129 tables, most of which are empty until activities are
imported; listing them all would bury the ones that matter. Use
kent details to see every table, including the empty
ones.
Reference and lookup tables are not treated specially.
FileTypeLookup, FieldTypeLookup, and the
better_labels_* tables are pre-seeded when a database is created, so they hold
rows and are listed like any other populated table. In a database created by
kent createdb and never imported into, those seeded
tables are the only thing kent info reports. That is expected, not a
fault.
Two schema versions are always shown
Both are printed because they can legitimately differ on a database that opens successfully:
- Schema version: what this database file stores.
- Expected by this build: what the version of Cordelia that Kent was built against writes.
A database written by a newer Cordelia opens normally and reports its
own higher version. A database written by an older Cordelia is refused
outright. Cordelia's database layer rejects it at open time rather than letting the
mismatch surface later as unreadable rows, so kent info prints that refusal
and exits 1. There is currently no way to migrate an old database.
A missing path is not created
A path that does not exist is reported as missing, and is not created. This matters because SQLite's own open call creates the file it is given, so a mistyped path would otherwise leave a stray empty database behind.
Examples
A freshly created database, where only the pre-seeded reference tables hold rows:
$ kent createdb mydata.sqlite
$ kent info mydata.sqlite
Database: mydata.sqlite
Schema version: 2
Expected by this build: 2
Table Rows
------------------------- -----
FieldTypeLookup 7
FileTypeLookup 20
better_labels_definitions 2811
better_labels_lookup 16866
------------------------- -----
Total (4 tables) 19704
A database older than this build understands:
$ kent info old.sqlite
kent info: failed to open database: This database uses an older schema and cannot be opened; version 2 is required. Create a new database and import your .FIT files again.
$ echo $?
1
A path that does not exist:
$ kent info nope.sqlite
kent info: nope.sqlite does not exist
$ echo $?
1
See also Reporting in Full with details and Error Messages and Exit Codes.