Added a readme file
This commit is contained in:
parent
04c2c07c6d
commit
3ed115f5f3
29
persistence/README.md
Normal file
29
persistence/README.md
Normal file
|
@ -0,0 +1,29 @@
|
||||||
|
## Database Persistence ##
|
||||||
|
The persistence package includes classes to store different class objects in a Postgres database.
|
||||||
|
|
||||||
|
### models ###
|
||||||
|
This defines models for all class objects that we want to persist. It is used for Object Relation Mapping (ORM)
|
||||||
|
of the class objects to database table columns
|
||||||
|
|
||||||
|
### repositories ###
|
||||||
|
This defines repository classes that contain CRUD methods for database operations.
|
||||||
|
|
||||||
|
### config_db ##
|
||||||
|
This Python file is a configuration class that contains variables that map to configuration parameters in a .env file.
|
||||||
|
It also contains a method ``def conn_string()`` which returns the connection string to a Postgres database.
|
||||||
|
|
||||||
|
### Base ##
|
||||||
|
This class has a constructor that establishes a database connection and returns a reference for database-related CRUD operations.
|
||||||
|
|
||||||
|
### db_migration ###
|
||||||
|
This Python file is in the root of Hub and should be run to create all the required Postgres database tables
|
||||||
|
|
||||||
|
### Database Configuration Parameter ###
|
||||||
|
A .env file (or environment variables) with configuration parameters described below are needed to establish a database connection:
|
||||||
|
```
|
||||||
|
DB_NAME=postgres-database-name
|
||||||
|
DB_USER=postgres-database-user
|
||||||
|
DB_PASSWORD=postgres-database-password
|
||||||
|
DB_HOST=database-host
|
||||||
|
DB_PORT=database-port
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user