Metadata-Version: 2.1
Name: aett-postgres-async
Version: 2.1.0
Summary: Postgres connector for aett event store
Author-email: Jacob Reimers <pypi@reimers.io>
License: MIT License
        
        Copyright (c) 2024 python_eventstore
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/jjrdk/aett
Keywords: events,event store,postgres
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: aett-domain>=2.1.0
Requires-Dist: asyncpg~=0.30.0
Provides-Extra: dev
Requires-Dist: pip-tools; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: behave; extra == "dev"

# Æt (Aett) is an Event Store for Python

[![Downloads](https://static.pepy.tech/badge/aett-postgres)](https://pepy.tech/project/aett-postgres)

Aett Postgres provides the ability to store and retrieve events from a Postgres.

## Usage

To create an event stream to manage events, you can use the `PersistenceManagement` class.

```python
import psycopg
from aett.postgres.EventStore import PersistenceManagement

# Set up a new event store
mgmt = PersistenceManagement(psycopg.connect("host=localhost port=5432 dbname=aett user=aett password=aett"))
mgmt.initialize()

# Drop the store
mgmt.drop()
```

The package also provides `CommitStore` and `SnapshotStore` classes that can be used to store and retrieve events. They
can be instantiated by providing a Postgres database connection and specifying the configured table name.

```python
from aett.postgres.EventStore import CommitStore, SnapshotStore
import pymongo.database

snapshot_store = SnapshotStore(psycopg.connect("host=localhost port=5432 dbname=aett user=aett password=aett"))
```
