Coder Social home page Coder Social logo

pgconfig-ce's Introduction

postgresql.conf compare

Compares parameters defined and their default values between PostgreSQL major versions. Hosted by RustProof Labs.

API reference available.

Deployment Instructions

Note: Need to update the sub-version of Python over time. Can use simply python3 but that can lead to using older unsupported versions based on distro-defaults.

cd ~/venv
python3.8 -m venv pgconfig
source ~/venv/pgconfig/bin/activate

Install requirements

source ~/venv/pgconfig/bin/activate
cd ~/git/pgconfig-ce
pip install -r requirements.txt

Run web server w/ uWSGI.

source ~/venv/pgconfig/bin/activate
cd ~/git/pgconfig-ce
python run_server.py

Add new config files

To add a new configuration version you need a Postgres database instance running that you can connect to. Activate the Python venv and start ipython.

source ~/venv/pgconfig/bin/activate
cd ~/git/pgconfig-ce/config_from_pg
ipython

Import

import generate

You'll be prompted for the database connection parameters. Ideally you are using a ~/.pgpass file, but the option is there to enter your password.

Database host [127.0.0.1]: 
Database port [5432]: 
Database name: postgres 
Enter PgSQL username: your_username
Enter password (empty for pgpass): 

Run the generation. Will create a file in the appropriate spot for the webapp. When adding a new version you need to add it to webapp/pgconfig.py as well as generating this file.

generate.run()

Preparing database objects... Database objects ready. Pickled config data saved to: ../webapp/config/pg15.pkl

Unit tests

Run unit tests.

python -m unittest tests/*.py

Or run unit tests with coverage.

coverage run -m unittest tests/*.py

Generate report.

coverage report -m webapp/*.py

Name                 Stmts   Miss  Cover   Missing
--------------------------------------------------
webapp/__init__.py      15      0   100%
webapp/config.py        25      0   100%
webapp/forms.py          6      0   100%
webapp/pgconfig.py     150     37    75%   26-27, 53, 71-73, 87-94, 115-122, 140-145, 162-170, 222-223, 300, 393, 417
webapp/routes.py        83     58    30%   20, 24, 30, 35, 40-43, 51, 56-75, 87, 92-119, 127-140, 143-155
--------------------------------------------------
TOTAL                  279     95    66%

Pylint

Run pylint.

pylint --rcfile=./.pylintrc -f parseable ./webapp/*.py ./config_from_pg/*.py

History

The open source (Community Edition) version of this project started as a manual fork of RustProof Labs' internal project, commit fcc0619. The original internal project will be retired as this project evolves.

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.