Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Marshal RecordIds into a simple string #190

Open
2 tasks done
Sergionx opened this issue Nov 19, 2024 · 0 comments
Open
2 tasks done

Feature: Marshal RecordIds into a simple string #190

Sergionx opened this issue Nov 19, 2024 · 0 comments

Comments

@Sergionx
Copy link

Is your feature request related to a problem?

The RecordID from the surreal models is great but now after the change in the SDK I have to refactor to map the id to a string. It would be great to have a simple way to resolve this

Example:
type CareerNode struct {
ID surrealModels.RecordID json:"id" validate:"required"
Name string json:"name" validate:"required"
Emoji string json:"emoji" validate:"required"
}

When I query them I get:
[
{
"id": {
"Table": "career",
"ID": "quimica"
},
"name": "Ingeniería quimica",
"emoji": "🧪"
},
{
"id": {
"Table": "career",
"ID": "sistemas"
},
"name": "Ingeniería de sistemas",
"emoji": "💾"
}
]

I would like id to be for example: career:quimica

Describe the solution

Maybe a function that a accepts a generic with a RecordId

Alternative methods

Don't know other method

SurrealDB version

2.0.0

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant