Open phughk opened 1 year ago
Instead of Type::thing
why not just using fmt.Sprintf(...)
and generate the uuid in go, not in sql query
...
id := uuid.new()
tableId := fmt.Sprintf("warehouse:%v", id)
sql := fmt.Sprintf("CREATE %v {
...
})
...
// same with RELATE too
Or use txt/template
if you fill confortable with
i think you can just do
LET $id = CREATE warehouse:uuid() CONTENT ... RETURN id
Describe the bug
It seems that parameters might not be properly passed as parameters to the db or something weird is happening. Maybe the query is incorrect, but it seems right. We need a test for this though to be certain. The tests are to verify parameters and escaping works as expected. We need to consider "thing", "ident", "table", and perhaps several more that need to have formatting handled correctly.
Steps to reproduce
From discord:
Results in
Workaround was
Expected behaviour
The original query should have worked. Or the workaround shouldn't have worked.
SurrealDB version
1.0.0-beta.9+20230726.43794700 for macos on aarch64
Contact Details
hugh@surrealdb.com, < worldwidepaniel on discord >
Is there an existing issue for this?
Code of Conduct