Skip to content

Tutorial: Compile the codebase

The codebase is the interface for your database. The major benefit of separating these components is that it enables additional uses to flexibly interact with and use the data stored in the database, while minimizing the chances that unwanted destructive or constructive errors are made. It additionally ensures that all users have a single source of truth, and are interacting with the data in a consistent manner.

In case you want to enable additional users, we recommend creating and maintaining a template codebase which can be downloaded and used to connect to your bespoke database. In essence, this is what Epiphyte is, but with additional modules to generate mock data and additional documentation.

A compiled codebase only really needs 4 modules: 1. access_info.py: a script containing the server, storage, and user information. 2. db_setup.py: a script containing all the table definitions and package imports. 3. config.py: a script containing any hard-coded variables or pieces of information. 4. query_functions: a script defining common interactions with the database as convenience functions.

Once a database is in a stable state, and these modules exist in a stable form, we recommend creating a private GitHub repository containing these scripts. New users can then clone and modify the relevant lines in access_info.py and then access and interact with the data.