PostgreSQL backup & restore CLI
Project description
koggi
- PostgreSQL backup & restore CLI (early foundation).
Quick start
1. INSTALL
pip install koggi
2. save settings in project root
# project-root/.env
KOGGI_DEFAULT_DB_NAME=db_name
KOGGI_DEFAULT_DB_USER=postgres
KOGGI_DEFAULT_DB_PASSWORD=password
KOGGI_DEFAULT_DB_HOST=localhost
KOGGI_DEFAULT_DB_PORT=5432
KOGGI_DEFAULT_SSL_MODE=prefer
KOGGI_DEFAULT_BACKUP_DIR=./backups
KOGGI_DEFAULT_ALLOW_RESTORE=true
3. download binary files
koggi binaries download
4. backup
koggi pg backup
5. restore
koggi pg restore
- Prepare a
.envwith at least one profile (DEFAULT example):
KOGGI_DEFAULT_DB_NAME=example
KOGGI_DEFAULT_DB_USER=postgres
KOGGI_DEFAULT_DB_PASSWORD=secret
KOGGI_DEFAULT_DB_HOST=localhost
KOGGI_DEFAULT_DB_PORT=5432
KOGGI_DEFAULT_SSL_MODE=prefer
KOGGI_DEFAULT_BACKUP_DIR=./backups
.env(dev1 example):
KOGGI_DEV1_DB_NAME=example
KOGGI_DEV1_DB_USER=postgres
KOGGI_DEV1_DB_PASSWORD=secret
KOGGI_DEV1_DB_HOST=localhost
KOGGI_DEV1_DB_PORT=5432
KOGGI_DEV1_SSL_MODE=prefer
KOGGI_DEV1_BACKUP_DIR=./backups
KOGGI_DEFAULT_ALLOW_RESTORE=false
- List profiles:
koggi config list - Test connection:
koggi config test DEFAULT - Create backup:
koggi pg backup -p DEFAULT - Restore latest:
koggi pg restore -p DEFAULT - Check binaries:
koggi binaries which
Notes
- Embedded binaries: Koggi can use packaged PostgreSQL tools.
- Place binaries under
src/koggi/_bin/<os>-<arch>/:- Example tags:
windows-x86_64,darwin-arm64,linux-x86_64. - Required files:
pg_dump[.exe],psql[.exe],pg_restore[.exe].
- Example tags:
- Or put them in cache:
%LOCALAPPDATA%/koggi/bin/<tag>/(Windows) or~/.cache/koggi/bin/<tag>/(Unix). - You can override via env:
KOGGI_PG_DUMP,KOGGI_PSQL,KOGGI_PG_RESTORE.
- Place binaries under
- If no embedded binary is found, Koggi falls back to system PATH.
- This is Phase 1 scaffold based on plan.md; more features will follow.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
koggi-0.1.1.tar.gz
(17.6 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
koggi-0.1.1-py3-none-any.whl
(24.4 kB
view details)
File details
Details for the file koggi-0.1.1.tar.gz.
File metadata
- Download URL: koggi-0.1.1.tar.gz
- Upload date:
- Size: 17.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
94da0aff4595a00c2612f99093ec75066bf8c3662123a33759fe392643d58043
|
|
| MD5 |
38b4e7ddec9b4e9eaef032cda8750157
|
|
| BLAKE2b-256 |
93ae35661dfa44e6d9856530c0eae2d7de440929a064a8fa738a447a7ea9048d
|
File details
Details for the file koggi-0.1.1-py3-none-any.whl.
File metadata
- Download URL: koggi-0.1.1-py3-none-any.whl
- Upload date:
- Size: 24.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.8.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
804b9f763a29476565974a801752af3bf3f9393c7acb9f931e389403f432b3ef
|
|
| MD5 |
fd5c430d40f9a0ce264eacc3ebd04038
|
|
| BLAKE2b-256 |
ea4a58d38b86d049a84f71f7faa655637ba14396d57b3c53f8063550e6008d41
|