https://github.com/flow-lab/flowdber
Secure, efficient PostgreSQL migration utility with built-in TLS support. Ideal for use as an InitContainer in Kubernetes to seamlessly set up your database environment before app launch. Ensures smooth migrations and secure data transfer, bolstering your application's resilience and data integrity.
https://github.com/flow-lab/flowdber
docker dockerhub golang initcontainer kubernetes minikube postgresql sql-scripts
Last synced: 2 months ago
JSON representation
Secure, efficient PostgreSQL migration utility with built-in TLS support. Ideal for use as an InitContainer in Kubernetes to seamlessly set up your database environment before app launch. Ensures smooth migrations and secure data transfer, bolstering your application's resilience and data integrity.
- Host: GitHub
- URL: https://github.com/flow-lab/flowdber
- Owner: flow-lab
- License: mit
- Created: 2020-01-26T20:45:59.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-03-26T08:20:34.000Z (about 2 years ago)
- Last Synced: 2024-11-17T02:08:47.698Z (over 1 year ago)
- Topics: docker, dockerhub, golang, initcontainer, kubernetes, minikube, postgresql, sql-scripts
- Language: Go
- Homepage:
- Size: 85 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FlowDBer [](https://github.com/flow-lab/flowdber/actions/workflows/docker-release.yml)
FlowDBer project includes a helper container that makes it easy to run SQL migration scripts using PostgreSQL on
Kubernetes. To use it, simply include it as an InitContainer in your deployment definition, following the instructions
in the Kubernetes documentation.
Check [minikube.yml](./minikube.yml) for example configuration.
### Requirements
- file name should be **UNIXTIME**-**WHAT**.sql, eg: 1580247785-user-table.sql or just **INDEX**-**WHAT**.sql, eg:
0-new-user-db.sql, 1-birthdate-column-in-user.sql etc
- sql scripts must be idempotent, which means that they can be run multiple times without causing any problems :)
## Project structure
- [./cmd](./cmd) - app implementation
- [./internal](./internal) - internal packages that should not be shared with other projects
- [./github](./.github) - GitHub Actions workflows
- [./certs](./certs) - certificates for TLS when running locally with docker compose
- [./db-scripts](./db-scripts) - database scripts that will be executed on startup when using docker compose
- [docker-compose.yaml](./docker-compose.yaml) - docker compose file for running locally
- [Makefile](./Makefile) - makefile for running commands during development
- [LICENSE](./LICENSE) - license file
## Requirements
- [golang](https://golang.org/doc/install) installation
- gui editor, e.g. [goland](https://www.jetbrains.com/go)
## DockerHub
[https://hub.docker.com/r/flowlab/flowdber](https://hub.docker.com/r/flowlab/flowdber)
## Logging
App is using [dlog](https://github.com/flow-lab/dlog) for logging. It is configured to log to stdout and stderr.
## Running locally
You can test it locally with [Minikube](https://kubernetes.io/docs/setup/learning-environment/minikube/). Start minikube
and apply `kubectl apply -f minikube.yml`.
## Credits
- This project was created by cookiecutter https://github.com/flow-lab/ms-template