cbor: cannot unmarshal array into Go struct field connection.RPCResponse[...].result of type time.Time
Steps to reproduce
DEFINE TABLE user SCHEMAFULL;
DEFINE FIELD email ON user TYPE string ASSERT string::is::email($value);
DEFINE FIELD password ON user TYPE string;
DEFINE FIELD jwt ON user TYPE option<string>;
DEFINE FIELD updated_at ON user TYPE datetime DEFAULT time::now();
type User struct {
ID *models.RecordID `json:"id,omitempty"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
user := User{
EMail: claims.EMail,
UpdatedAt: time.Now(),
}
_, err = surrealdb.Create[User](DB, models.Table("user"), user)
Expected behaviour
Should unmarshal datetime field to time.Time
SurrealDB version
2.0.4 for linux on x86_64
Contact Details
No response
Is there an existing issue for this?
[X] I have searched the existing issues
Code of Conduct
[X] I agree to follow this project's Code of Conduct
Describe the bug
I get this error while creating a record
Steps to reproduce
Expected behaviour
Should unmarshal datetime field to time.Time
SurrealDB version
2.0.4 for linux on x86_64
Contact Details
No response
Is there an existing issue for this?
Code of Conduct