Description
The latest Docker tag of surrealdb/surrealdb moved to SurrealDB v3 (currently v3.1.4). Unlike v2, SurrealDB v3 no longer creates namespaces and databases implicitly on USE. As a result, all tests and benchmarks of the surrealdb module failed with:
The namespace 'testns' does not exist
As a quick fix, the test image was pinned to surrealdb/surrealdb:v2 (commit 1497c152). The storage driver itself currently does not work against a SurrealDB v3 server when namespace and database do not exist yet.
Proposed changes
- Sign in first, then ensure namespace and database exist before selecting them:
- run
DEFINE NAMESPACE IF NOT EXISTS <ns> and DEFINE DATABASE IF NOT EXISTS <db> (requires sufficient privileges), then call Use
- note:
surrealdb.go:37 currently calls db.Use() before db.SignIn(), this order needs to be swapped
- Bump
github.com/surrealdb/surrealdb.go (currently v1.4.0, targets SurrealDB 2.x) once a v3-compatible release is available
- Switch the test image back from the v2 pin to a v3 tag and verify tests and benchmarks pass
Additional context
First green run on main with the v2 pin: https://github.com/gofiber/storage/actions/runs/27302185817
Description
The
latestDocker tag ofsurrealdb/surrealdbmoved to SurrealDB v3 (currently v3.1.4). Unlike v2, SurrealDB v3 no longer creates namespaces and databases implicitly onUSE. As a result, all tests and benchmarks of the surrealdb module failed with:As a quick fix, the test image was pinned to
surrealdb/surrealdb:v2(commit 1497c152). The storage driver itself currently does not work against a SurrealDB v3 server when namespace and database do not exist yet.Proposed changes
DEFINE NAMESPACE IF NOT EXISTS <ns>andDEFINE DATABASE IF NOT EXISTS <db>(requires sufficient privileges), then callUsesurrealdb.go:37currently callsdb.Use()beforedb.SignIn(), this order needs to be swappedgithub.com/surrealdb/surrealdb.go(currently v1.4.0, targets SurrealDB 2.x) once a v3-compatible release is availableAdditional context
First green run on main with the v2 pin: https://github.com/gofiber/storage/actions/runs/27302185817