Creating a Database with createdb

kent createdb creates an empty Cordelia database: every table in the schema is created up front, with zero rows, except the two reference lookup tables (FileTypeLookup and FieldTypeLookup), which are always pre-seeded with their fixed rows as part of table creation, the same as a database created through Cordelia's own desktop interface.

Synopsis

kent createdb <dbfilename>

It never overwrites an existing file

kent createdb refuses to run if <dbfilename> already exists. It never reuses or overwrites an existing file. Cordelia's own New Database action can rely on a save-file dialog to ask first; a terminal command has no such prompt, so kent createdb errs on the side of doing nothing rather than silently touching a file that's already there. If you want to recreate a database, remove the existing file yourself first.

Examples

Creating a new database. On success it prints nothing at all:

$ kent createdb mydata.sqlite
$

Refusing to overwrite an existing file:

$ kent createdb mydata.sqlite
kent createdb: mydata.sqlite already exists
$ echo $?
1

What to do next

A freshly created database holds only the pre-seeded reference tables. See Reporting on a Database with info for what that looks like. To put real activity data into it, import .FIT files with Cordelia; see How to Import .FIT Files into Your Cordelia Database.

See also Error Messages and Exit Codes.

See also