Metadata-Version: 2.4
Name: SecantusDB
Version: 0.5.3b196
Summary: Single-node MongoDB- and PostgreSQL-wire servers over WiredTiger, for tests and CI
Author-email: Joe Drumgoole <joe@joedrumgoole.com>
License-Expression: GPL-2.0-only
License-File: LICENSE
License-File: LICENSE-ICU
Project-URL: Homepage, https://secantusdb.com
Project-URL: Source, https://github.com/jdrumgoole/SecantusDB
Requires-Python: >=3.10
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Database :: Database Engines/Servers
Classifier: Topic :: Software Development :: Testing
Description-Content-Type: text/markdown

# SecantusDB

SecantusDB is a pair of single-node database servers, one speaking the
MongoDB wire protocol and one speaking the PostgreSQL wire protocol (beta),
both over the WiredTiger storage engine MongoDB ships. Point your tests at it
instead of standing up a real `mongod` or `postgres`.

This wheel bundles both servers as prebuilt binaries for Linux x86_64 and
macOS arm64:

| command | server | version |
| --- | --- | --- |
| `secantusd-rs` | MongoDB wire | 0.5.3-beta.196 |
| `secantusd-pg` | PostgreSQL wire (beta) | 0.1.0-beta.17 |

## Start a server in a test

```python
import pymongo
from secantusdb import MongoServer

with MongoServer() as server:
    client = pymongo.MongoClient(server.uri)
    client.test.things.insert_one({"x": 1})
```

```python
import psycopg
from secantusdb import PostgresServer

with PostgresServer() as server:
    with psycopg.connect(server.dsn) as conn:
        print(conn.execute("select 1").fetchone())
```

Each server gets a free port and a temporary data directory, removed when
the `with` block ends. Pass `storage_path=` to keep the data, or `port=` to
pick the port.

## Run a server from the shell

```
secantusd-rs --port 27018 --storage-path ./data
secantusd-pg ./pgdata 127.0.0.1:5433
```

Licence: GPL-2.0-only. Documentation: https://secantusdb.com
