Metadata-Version: 2.5
Name: snapdelta-postgres
Version: 0.2.0
Summary: PostgreSQL store backend for snapdelta: snapshots, diffs and runs in a database that many servers share
Project-URL: Homepage, https://github.com/antoinekh/snapdelta
Project-URL: Documentation, https://github.com/antoinekh/snapdelta/blob/main/docs/stores.md
Project-URL: Issues, https://github.com/antoinekh/snapdelta/issues
Project-URL: Changelog, https://github.com/antoinekh/snapdelta/blob/main/CHANGELOG.md
Author-email: Antoine Keranflec'h <antoine.keranflech@gmail.com>
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: diff,netdevops,network-automation,plugin-architecture,postgresql,snapshot
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: System Administrators
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Database
Classifier: Topic :: System :: Networking
Classifier: Typing :: Typed
Requires-Python: >=3.13
Requires-Dist: psycopg-pool<4,>=3.2
Requires-Dist: psycopg[binary]<4,>=3.2
Requires-Dist: snapdelta<0.3,>=0.2.0
Description-Content-Type: text/markdown

# snapdelta-postgres

A PostgreSQL store backend for [snapdelta](https://github.com/antoinekh/snapdelta): the snapshots, the diffs and the runs in a database, which many snapdelta servers and workers can share.

```bash
pip install snapdelta-postgres
snapdelta --store postgresql://snapdelta@db.example.net/snapdelta info
```

The location is a libpq URI without its password, such as `postgresql://USER@HOST:PORT/DATABASE?sslmode=require`; snapdelta shows the location in its pages and its runs. Give the password in the settings, or in `PGPASSWORD` or `~/.pgpass`:

```toml
[store]
location = "postgresql://snapdelta@db.example.net/snapdelta"

[stores.postgresql]
password = { env = "SNAPDELTA_DB_PASSWORD" }
connect_timeout_s = 10
pool_size = 4
```

The store creates its three tables, `snapdelta_snapshots`, `snapdelta_outputs` and `snapdelta_runs`, at its first use; the user needs the right to create tables in the database. The bodies are the JSON documents of the file store, as `json`, which keeps their order. See [docs/stores.md](https://github.com/antoinekh/snapdelta/blob/main/docs/stores.md).
