surrealdb / surrealdb.go

SurrealDB SDK for Golang
https://surrealdb.com
Apache License 2.0
239 stars 66 forks source link

Bug: RecordID parameter is not recognized in transaction block #177

Open agufagit opened 3 hours ago

agufagit commented 3 hours ago

Describe the bug

RecordID parameter is not recognized in transaction block

Steps to reproduce

following code returns: data: []

data, err := surrealdb.Query[any](conn,
        `BEGIN;
        CREATE t:1 SET name='test';
        LET $i = SELECT * FROM $id;
        RETURN $i;
        COMMIT;`,
        map[string]any{
            "id": models.RecordID{Table: "t", ID: "1"},
        })
fmt.Printf("data: %v\n", data1)

Expected behaviour

expected returns: data: [map[id:{t 1} name:test]]

SurrealDB version

surreal 2.0.4

Contact Details

No response

Is there an existing issue for this?

Code of Conduct

agufagit commented 3 hours ago

confirmed it's not recognized inside begin; commit; block, but outside begin; commit; block, it's recognized, is this a bug for surrealdb itself?