Metadata-Version: 2.2
Name: surrealdb-rpc
Version: 0.1.3
Summary: A Python library for interacting with SurrealDB via RPC.
Author: Manuel Schaaf
Project-URL: Homepage, https://github.com/manu-schaaf/surrealdb-rpc.py
Project-URL: Issues, https://github.com/manu-schaaf/surrealdb-rpc.py/issues
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: msgpack>=1.1.0
Requires-Dist: requests>=2.32.3
Requires-Dist: ulid>=1.1
Requires-Dist: uuid7>=0.1.0
Requires-Dist: websockets>=14.1

# SurrealDB RPC Python Client

## Example Usage

```python
from surrealdb_rpc.client.websocket import SurrealDBClient
from surrealdb_rpc.data_model import RecordId

with SurrealDBClient(
    host="localhost",
    port=8000,
    ns="test",
    db="test",
    user="root",
    password="root",
) as db:
    response = db.create(
        "example:123",
        text="Some value",
        reference=RecordId.new("other", {"foo": {"bar": "baz"}}),
        array=[1, 2, 3],
        object={"key": "value"},
    )
    print(response)
```

This should create this record in the database:

```json
{
  array: [
    1,
    2,
    3
  ],
  id: example:123,
  object: {
    key: 'value'
  },
  reference: other:{
  foo: {
    bar: 'baz'
  }
  },
  text: 'Some value'
}
```
