Thanks to visit codestin.com
Credit goes to github.com

Skip to content

in-op/imbi-schema

 
 

Repository files navigation

Imbi DDL

Canonical location for the PostgreSQL Imbi DDL.

ERD

ERD

Docker Image

There is a Dockerfile that creates an image that can be used for testing against Imbi database.

Example use in docker-compose.yaml:

%YAML 1.2
---
Imbi:
  image: aweber/imbi-postgres:latest
  ports:
    - 5432

Extending or Editing

The MANIFEST file contains all of the files that are used to construct the DDL that is used for the Imbi system. It should be edited for any files that are added or removed. The files are ordered properly for dependency in the MANIFEST file and care should be taken to ensure it stays that way.

Testing

The Makefile contains all of the glue required to tests against your DDL. All files ending in .sql will be lint checked using sqlint.

Tests are written using pgTap and all testing requirements are contained in the PostgreSQL container specified in the docker-compose.yaml.

The plpgsql_check extension is installed and should be used as part of your pgTAP tests. For example, the following example checks to ensure the function exists and that there are no linting errors:

BEGIN;
SELECT plan( 2 );

SELECT has_function('v1'::NAME, 'project_score'::NAME);

SELECT is_empty(
    $$SELECT * FROM plpgsql_check_function('v1.project_score(INTEGER)');$$,
    'v1.project_score/1 has no plpgsql_check errors');

SELECT * FROM finish();
ROLLBACK;

To ensure your environment is ready for running tests run make bootstrap and then run make test. Test output will be sent to the console and recorded in JUnit output in the reports/junit_output.xml file.

.gitkeep Files

.gitkeep files can and should be removed once you add a file to an empty directory.

About

DDL for the Imbi PostgreSQL Database

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PLpgSQL 89.3%
  • Shell 5.3%
  • Makefile 5.2%
  • Dockerfile 0.2%