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 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.1.3.tar.gz (22.2 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.1.3-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: surrealdb_rpc-0.1.3.tar.gz
  • Upload date:
  • Size: 22.2 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.1.3.tar.gz
Algorithm Hash digest
SHA256 0a4261e436e3d9250a3f0d307c9cee59048667f54622e55a2b457ec4bffaab03
MD5 3eb5a78d7c483e428c390bd37e1c1622
BLAKE2b-256 18e7492ba2fe8c5ad8bacddd81cd639eb675cb9c93b79cb2ae4d6a251fd1ba56

See more details on using hashes here.

File details

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

File metadata

  • Download URL: surrealdb_rpc-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 23.8 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.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 15141b2f7aaf44ccbab3ca264f198cec4f7fff9f7977a90237e98e60e48f3b3f
MD5 5e340280c3dc4a138ab947d160dffc93
BLAKE2b-256 fe9b0c1f7c469e5bcf9474eeb2645df5586fb673c80e9a7f22c241f057a74827

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