Sign inSign up

dbinvent/sge

By dbinvent

•Updated about 11 hours ago

Schema Guard: PostgreSQL schema migration, SQL scripts and declarative YAML (MIT)

Image
0

50

dbinvent/sge repository overview

⁠Schema Guard (sge): PostgreSQL schema migration

A static sge and the psql it applies SQL files with, on Alpine - about 12 MB. Open source, MIT: DBinvent/sge⁠.

  • A Flyway replacement with no JVM: versioned scripts (V1_2__init.sql) and repeatables (R__view.sql) run as they are
  • Declarative and imperative, mixed: a whole schema in one YAML file, turned into SQL for you, beside plain SQL scripts
  • History in the target database: every environment knows which versions it applied, with which checksum (sge_history)

Docs: dbinvent.com/sge⁠ - downloads⁠ (apt, static binary, crate).

⁠Tags

2.0.1, ... (a version), 2.0 (its latest), latest. x86-64.

⁠Use

The image runs sge in /work: mount the migrations there.

docker run --rm -v "$PWD:/work" dbinvent/sge \
    --db_url=postgres://app:[email protected]/app --source_dir=. migrate

# a config file in the same directory, a database on the same machine
docker run --rm --network host -v "$PWD:/work" dbinvent/sge -c sge.cfg migrate

docker run --rm dbinvent/sge help migrate

sge.cfg takes the options by the same names, without the --:

db_host=localhost
db_name=app
db_user=app
source_dir=.

git is not in the image: a git script source (source_git) needs an image built FROM dbinvent/sge that adds it (apk add git openssh-client).

On a YT Cluster⁠, a migration applies to the node it runs on: run it against each node in turn.

⁠License

MIT. The image carries it in /usr/share/doc/schema-guard/LICENSE. PostgreSQL's client and Alpine are under their own licenses.

Tag summary

Content type

Image

Digest

sha256:c07424f70…

Size

11.4 MB

Last updated

about 11 hours ago

docker pull dbinvent/sge