I made my SurrealDB driver work and am currently testing it - and while testing the more "not so standart" parts of SurrealDB, I realized that... I had no idea how to run raw queries.
func main() {
adapter, err := srel.Open("ws://root:root@127.0.0.1:8000/rpc?method=root")
if err != nil {
log.Fatal(err.Error())
}
defer adapter.Close()
repo := rel.New(adapter)
sql := rel.SQL("INFO FOR ROOT;")
cursor, err := adapter.Query(context.TODO(), rel.Query{
SQLQuery: sql,
})
if err != nil {
log.Fatal(err.Error())
}
fields, err := cursor.Fields()
if err != nil {
log.Fatal(err.Error())
}
fmt.Print(fields)
}
Is there an easier way to construct raw queries? I can't imagine it's this convoluted... x)
Kind regards,
Ingwie
I made my SurrealDB driver work and am currently testing it - and while testing the more "not so standart" parts of SurrealDB, I realized that... I had no idea how to run raw queries.
Is there an easier way to construct raw queries? I can't imagine it's this convoluted... x)
Kind regards,
Ingwie