https://github.com/mikoweb/postgres-framework
Simple framework for PostgreSQL
https://github.com/mikoweb/postgres-framework
framework postgresql
Last synced: 6 months ago
JSON representation
Simple framework for PostgreSQL
- Host: GitHub
- URL: https://github.com/mikoweb/postgres-framework
- Owner: mikoweb
- License: other
- Created: 2017-06-09T22:59:27.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-29T14:12:28.000Z (over 8 years ago)
- Last Synced: 2025-10-09T13:33:46.421Z (6 months ago)
- Topics: framework, postgresql
- Language: PLpgSQL
- Homepage: https://rmweb.pl
- Size: 35.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PostgreSQL Framework
It's simple framework for PostgreSQL database with unit tests and versioning.
Created based on:
- [PostgreSQL Unit Testing Framework](https://github.com/mixerp/plpgunit)
- [Schema Evolution Manager (sem)](https://github.com/mbryzek/schema-evolution-manager)
## Install framework
bundle install
## Add framework scripts
bundle exec sem-add-framework
## Add script
bundle exec sem-add-safe ./new-script.sql
## Applying changes to your local database
bundle exec sem-apply --url postgresql://postgres@localhost/sample --password
## Other commands
Go to [Schema Evolution Manager (sem)](https://github.com/mbryzek/schema-evolution-manager).
## Run tests
BEGIN TRANSACTION;
SELECT * FROM unit_tests.begin();
ROLLBACK TRANSACTION;
## Writing tests
Go to [PostgreSQL Unit Testing Framework](https://github.com/mixerp/plpgunit).
## Uninstall tests
DROP SCHEMA IF EXISTS assert CASCADE;
DROP SCHEMA IF EXISTS unit_tests CASCADE;
DROP DOMAIN IF EXISTS public.test_result CASCADE;
## Uninstall framework
It's' dangerous.
DROP SCHEMA IF EXISTS framework CASCADE;