Giter VIP home page Giter VIP logo

qwc-config-db's Introduction

QWC Configuration Database

Setup database schema for configurations and permissions of QWC services using Alembic database migrations.

Shared module for providing SQLAlchemy ORM models for ConfigDB queries.

Setup

Uses PostgreSQL connection service qwc_configdb (ConfigDB) (cf. sqlalchemy.url and version_table_schema in alembic.ini).

Setup PostgreSQL connection service file pg_service.conf:

[qwc_configdb]
host=localhost
port=5439
dbname=qwc_demo
user=qwc_admin
password=qwc_admin
sslmode=disable

Place this file in your home directory, or set the PGSERVICEFILE environment variable to point to the file.

Create user according to service qwc_configdb:

CREATE ROLE qwc_admin LOGIN PASSWORD 'qwc_admin';

Create schema for migration table and ConfigDB in qwc_configdb:

CREATE SCHEMA qwc_config AUTHORIZATION qwc_admin;

Usage

Run commands from this directory.

Create a migration script:

alembic revision -m "create sample table"

Edit generated migration script alembic/versions/123456abcdef_create_sample_table.py

Run migrations:

alembic upgrade head

Upgrade one version:

alembic upgrade +1

Downgrade one version:

alembic downgrade -1

Development

Install Python module for PostgreSQL:

apt-get install python3-psycopg2

Create a virtual environment:

virtualenv --python=/usr/bin/python3 --system-site-packages .venv

Without system packages:

virtualenv --python=/usr/bin/python3 .venv

Activate virtual environment:

source .venv/bin/activate

Install requirements:

pip install -r requirements.txt

qwc-config-db's People

Contributors

manisandro avatar mwa avatar pka avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.