unstale

pypi / surrealdb

surrealdb

What changed in surrealdb 1 to 3, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.

16 breaking4 security63 new APIs and options5 behavior and defaults8 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli 0.3.1 on npm

surrealdb 378 changes

Breaking changes 13

  • A datetime.date is now sent as a SurrealDB date; a naive datetime.time is sent as a SurrealDB time.

    3.0.0upgrade guide

  • Calls DEFINE API endpoints and returns an ApiResponse; requires SurrealDB 3.0 or later and the define_api capability.

    3.0.0upgrade guide

  • A string passed to select() is always treated as a table name; pass a RecordID or StringRecordId to select a record.

    3.0.0release notes

  • The SDK sends Decimal values in plain notation, as required by SurrealDB 4.0.

    3.0.0release notes

  • The embedded engine cannot open file:// or surrealkv:// databases written by a 3.x engine; export with a 3.x surreal binary and import into a new database to keep the data.

    3.0.0release notesupgrade guide

  • A plain string is always a table name, not a parsed record id or range; use StringRecordId or RecordID to target records.

    3.0.0upgrade guide

  • Passing a compiled regular expression now raises TypeError and points callers to Regex because its former CBOR tag is refused by SurrealDB.

    3.0.0upgrade guide

  • Responses are validated as strictly as SurrealDB 4.0 requests; payloads that do not hold a SurrealDB value raise UnexpectedResponseError.

    3.0.0upgrade guide

  • Rust 1.95 or later is required to build the embedded extension from source.

    3.0.0release notesupgrade guide

  • The default client IP detection method changes from none to socket.

    3.0.0docs

  • The environment variable entry for naming a model with ml export is removed from the documented command environment variables.

    3.0.0docs

  • The documented version setting for ml export is removed.

    3.0.0docs

  • The SDK checks the server version on connect and refuses versions older than 2.0 or newer than 4.x; set version_check=False to skip the check.

    3.0.0release notesupgrade guide

Security 4

  • The SDK adds revoke() among its session and token operations.

    3.0.0release notesupgrade guide

  • Adds a start capability setting to deny arbitrary queries for selected user groups, or all groups when no value is given; specifically allowed groups take precedence.

    3.0.0docs

  • Adds a start capability setting to deny all HTTP routes except those allowed, or to deny only a listed set of routes.

    3.0.0docs

  • Adds a start capability setting to deny all RPC methods except those allowed, or to deny only a listed set of methods.

    3.0.0docs

New APIs and options 58

  • Pass auth= when connecting to sign in; the connection renews its access token before it expires.

    3.0.0release notesupgrade guide

  • The SDK supports the BigDecimal type.

    3.0.0release notes

  • The SDK supports the cbor.2 format.

    3.0.0release notesupgrade guide

  • Use db.api() for DEFINE API endpoints.

    3.0.0release notes

  • Send several statements as one transaction with db.batch().

    3.0.0release notesupgrade guide

  • Use db.begin_transaction() as a context manager.

    3.0.0release notesupgrade guide

  • Remote connections add db.export().

    3.0.0release notesupgrade guide

  • Remote connections add db.export_to().

    3.0.0release notesupgrade guide

  • The SDK adds db.gql().

    3.0.0release notesupgrade guide

  • The SDK adds db.graphql().

    3.0.0release notesupgrade guide

  • Checks the server's health endpoint and raises ConnectionUnavailableError if the server is unhealthy or unreachable.

    3.0.0upgrade guide

  • Remote connections add db.import_().

    3.0.0release notesupgrade guide

  • Checks whether the connected server supports a feature; unsupported features are rejected before a request is sent.

    3.0.0upgrade guide

  • Exchanges a refresh token for a new token pair, authenticates with the new access token and defaults to the connection's tokens.

    3.0.0upgrade guide

  • The SDK adds db.relate().

    3.0.0release notesupgrade guide

  • Lists the ids of sessions attached on the server.

    3.0.0upgrade guide

  • The SDK exposes connection status through db.status.

    3.0.0release notes

  • Reports connection status as disconnected, connecting, reconnecting or connected; db.subscribe registers event listeners and returns an unsubscribe function.

    3.0.0upgrade guide

  • The SDK adds db.subscribe(event, listener).

    3.0.0release notes

  • The SDK supports sized numbers such as F32.

    3.0.0release notes

  • The query builder adds a fetch() method.

    3.0.0release notes

  • The SDK adds fork_session() among its session and token operations.

    3.0.0release notesupgrade guide

  • The SDK adds health() among its session and token operations.

    3.0.0release notes

  • The SDK supports sized numbers such as I32.

    3.0.0release notes

  • Adds fixed-width numeric types I8, U8, I16, U16, I32, U32, U64, F16 and F32, with range checks and width rounding where applicable.

    3.0.0upgrade guide

  • The SDK supports the Interval type.

    3.0.0release notes

  • Call kill() on a live-query subscription to stop it.

    3.0.0release notes

  • The set operation is available under its JS SDK name on connections, sessions and transactions.

    3.0.0upgrade guide

  • The query builder adds a limit() method.

    3.0.0release notes

  • live() returns a subscription that can be iterated to receive notifications.

    3.0.0release notesupgrade guide

  • Attaches to a live query started by another means, such as a LIVE SELECT sent with query(); it is not restarted after reconnect.

    3.0.0upgrade guide

  • The query builder adds an output() method.

    3.0.0release notesupgrade guide

  • The SDK supports the PlainDate type.

    3.0.0release notes

  • Adds SurrealDB 4.0 value types PlainDate, PlainTime, Timestamp, Interval, BigDecimal and Regex, with conversions and value behavior described in the notes.

    3.0.0upgrade guide

  • The SDK supports the PlainTime type.

    3.0.0release notes

  • WebSocket connections reconnect automatically and restore connection state and live queries; set reconnect=False to disable this.

    3.0.0release notesupgrade guide

  • Configures reconnect attempts, delay, maximum delay, multiplier and jitter.

    3.0.0upgrade guide

  • The SDK adds refresh() among its session and token operations.

    3.0.0release notes

  • The SDK supports the Regex type.

    3.0.0release notes

  • Connections renew their own access token shortly before expiry by default, using a refresh token when supported or applying auth again.

    3.0.0upgrade guide

  • The SDK adds reset() among its session and token operations.

    3.0.0release notesupgrade guide

  • Select builders add fetch, limit, start and version modifiers, compiled into the SurrealQL statement.

    3.0.0upgrade guide

  • The SDK adds sessions() among its session and token operations.

    3.0.0release notes

  • The query builder adds a start() method.

    3.0.0release notes

  • Represents a record id written as SurrealQL for the server to parse, including ids that RecordID.parse refuses; usable wherever a RecordID is accepted.

    3.0.0upgrade guide

  • Adds a start capability setting to allow all HTTP routes except those denied, or to allow only a listed set of routes.

    3.0.0docs

  • Adds a start capability setting to allow all RPC methods except those denied, or to allow only a listed set of methods.

    3.0.0docs

  • Adds a start setting for how often a node checks for unfinished index builds left by stopped nodes and resumes them; set to 0 to disable.

    3.0.0docs

  • Configures how often the TiKV MVCC garbage collector runs; it defaults to 10m and is only used with a TiKV datastore. The start command also accepts tikv-gc-interval.

    3.0.0docs

  • Sets how far behind the current timestamp the TiKV garbage collection safepoint may sit; it defaults to 10m. The effective SURREAL_RECLAIM_GRACE is never shorter than this value.

    3.0.0docs

  • Configures how often stale TiKV transaction locks are resolved; it defaults to 60s and is only used with a TiKV datastore. The start command also accepts tikv-lock-cleanup-interval.

    3.0.0docs

  • Add the embedded extra to use mem://, file:// or surrealkv://.

    3.0.0release notes

  • The query builder adds a timeout() method.

    3.0.0release notesupgrade guide

  • The SDK supports the Timestamp type.

    3.0.0release notes

  • The SDK raises UnexpectedResponseError when a response does not contain a valid SurrealDB value.

    3.0.0release notes

  • Can change only the database or namespace; None preserves the current value and Null clears it.

    3.0.0upgrade guide

  • The query builder adds a version() method.

    3.0.0release notes

  • The query builder adds a where() method.

    3.0.0release notesupgrade guide

Behavior and default changes 1

  • The default log file format changes from none to text.

    3.0.0docs

Fixes and other changes 2

  • Decimal values are sent in plain notation, and trailing zeros beyond SurrealDB's 28-digit scale are dropped so the server accepts them.

    3.0.0upgrade guide

  • select(fields=[...]) accepts fields named after keywords, such as value.

    3.0.0release notesupgrade guide

surrealdb 25 changes

Breaking changes 1

New APIs and options 1

Behavior and default changes 2

Fixes and other changes 1

  • Fixes the WebSocket session transaction ID issue.

    2.0.0release notes

surrealdb 113 changes

Breaking changes 2

  • GeometryPolygon enforces GeoJSON-compliant closed linear rings.

    1.0.7release notes

  • Database method return types are simplified to Value.

    1.0.7release notes

New APIs and options 4

  • Live queries initiated in db.query can now be subscribed to.

    1.0.7release notes

  • Adds support for using a native embedded database.

    1.0.7release notes

  • The client issues text-based queries instead of using the v1 RPC methods.

    1.0.7release notes

  • Initial stable release of the SurrealDB Python client.

    1.0.0release notes

Behavior and default changes 2

  • RecordId can now be serialized and deserialized by pydantic.

    1.0.8release notes

  • Duration.parse() supports parsing compound durations.

    1.0.7release notes

Fixes and other changes 5

  • The package now supports Python 3.9.

    1.0.8release notes

  • Fixes a race condition in concurrent environments.

    1.0.7release notes

  • Fixes encoding of decimal.Decimal values.

    1.0.7release notes

  • Fixes Duration encoding and decoding.

    1.0.7release notes

  • String identifiers in RecordID are escaped to match SurrealDB behaviour.

    1.0.7release notes