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.1.tar.gz (21.9 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.1-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: surrealdb_rpc-0.1.1.tar.gz
  • Upload date:
  • Size: 21.9 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.1.tar.gz
Algorithm Hash digest
SHA256 8fe12b729dbd1e2a37f51b71f94106a7fe396743e5f35592a122637bc64f89ff
MD5 037da6c55ced8e9e31d2fb8f185b0d77
BLAKE2b-256 122d64b6a4dc1a6343e3909c5f68360cdfca91e5af7f014376b532869dd75fa8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: surrealdb_rpc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 23.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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 333ae0f6d69e2c4ad169a5aff1aa314e2dd35a292902cc174ba5844a1aa3a297
MD5 ccb195c0ff1f6afacd7579462cce7b59
BLAKE2b-256 0e5a7ee02e1dc4ff298c6f97e0b312e94434da942a7dc85a3af12165baa9bbb9

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