Skip to main content

A Python library for interacting with SurrealDB via RPC.

Project description

SurrealDB RPC Python Client

Example Usage

from surrealdb_rpc.client.websocket.surrealdb 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:

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

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

surrealdb_rpc-0.2.0.tar.gz (25.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

surrealdb_rpc-0.2.0-py3-none-any.whl (30.5 kB view details)

Uploaded Python 3

File details

Details for the file surrealdb_rpc-0.2.0.tar.gz.

File metadata

  • Download URL: surrealdb_rpc-0.2.0.tar.gz
  • Upload date:
  • Size: 25.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for surrealdb_rpc-0.2.0.tar.gz
Algorithm Hash digest
SHA256 e105983639f088a71ab4b9199b82263cda355b2a0d2fabaaa4126c2730d07ded
MD5 c1c8f74c4f1cc054946d19f5c9ac9e9d
BLAKE2b-256 c78eec63f1297c98d541568150374c09ae07a45a3f31eedc95d21b901e76900d

See more details on using hashes here.

File details

Details for the file surrealdb_rpc-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: surrealdb_rpc-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 30.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.1

File hashes

Hashes for surrealdb_rpc-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51b6b85d5c919f66e791f984ec836e4ca32483c19e3a0d6942bc0eca3eb5dfd7
MD5 514bfe9e9026a13b86aa84fb7bec4fb8
BLAKE2b-256 a7d862b4308cebcb8c6fbd094ea61b6f6002f3b49df8a40bf3c1563c7b310425

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page