Server installation
Requirements
-
PostgreSQL server
-
Python 3.6+
-
Python libraries aiohttp, aiohttp-jinja2 and asyncpg.
pip3 install aiohttp
pip3 install aiohttp-jinja2
pip3 install asyncpg
Installing a database
TipThe script
labxdb_install.sh
available in the contrib/virt
folder of LabxDB repository installs LabxDB and its dependencies. Please refer to this script for details about LabxDB installation.
-
Install PostgreSQL server, Python and Python libraries.
-
Create a
lab
role to connect to PostgreSQL. -
Import schema describing a database. Example databases are available in
contrib/databases/sql
folder of the LabxDB repository. The schema are templates. To load them and replace the variables in the templates, the simple scripttpl_sql.py
can be used. To connect to PostgreSQL server, a user with admin rights, here postgres, is required.tpl_sql.py -s -a schema,purchase -u postgres create_order_tables.sql
-
Start LabxDB server application. For example:
app.py --port=8081 --db_host=localhost --db_user=lab --db_password="labxdb" --db_name=postgres --db_conn=2