You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I run the readme code, it creates distinct columns depending on whether the person is created with map[interface{}]interface{}{} or the Person struct.
I changed the code so that it creates Jane Doe for the Person Struct, and it makes the columns lowercase because of the JSON annotations.
Should the map[interface{}]interface{}{} use lowercase for the fieldnames, like this
Hi @nickchomey
This is a go related issue. The field names are dependent on the input. For struct types, with no JSON or CBOR tags, the column name will be the Field name else it will be the name on the tag. For example surrealdb.Auth has fields Username and Password; while the backend expects user and pass instead. If those fields weren't tagged, that would have been an invalid request.
@remade It doesnt look like this was addressed in #163 - the readme is still the same, resulting in the issue reported here. Something should change, one way or the other, so that the Readme code works when someone tries to get started with this sdk.
Describe the bug
When I run the readme code, it creates distinct columns depending on whether the person is created with
map[interface{}]interface{}{}
or thePerson
struct.I changed the code so that it creates Jane Doe for the Person Struct, and it makes the columns lowercase because of the JSON annotations.
Should the
map[interface{}]interface{}{}
use lowercase for the fieldnames, like thisOr should the Person struct use uppercase in the json annotations?
Or should the sdk hande all of this automatically (perhaps automatically making all field names lowercase)?
Steps to reproduce
Run the readme code
Expected behaviour
That the two methods would use the same columns
SurrealDB version
latest
Contact Details
No response
Is there an existing issue for this?
Code of Conduct
The text was updated successfully, but these errors were encountered: