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

Bug: RecordID parameter is not recognized in transaction block #177

Open
2 tasks done
agufagit opened this issue Nov 2, 2024 · 3 comments
Open
2 tasks done

Bug: RecordID parameter is not recognized in transaction block #177

agufagit opened this issue Nov 2, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@agufagit
Copy link

agufagit commented Nov 2, 2024

Describe the bug

RecordID parameter is not recognized in transaction block

Steps to reproduce

following code returns: data: []

data, err := surrealdb.Query[any](conn,
		`BEGIN;
		CREATE t:1 SET name='test';
		LET $i = SELECT * FROM $id;
		RETURN $i;
		COMMIT;`,
		map[string]any{
			"id": models.RecordID{Table: "t", ID: "1"},
		})
fmt.Printf("data: %v\n", data)

Expected behaviour

expected returns: data: [map[id:{t 1} name:test]]

SurrealDB version

surreal 2.0.4

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
@agufagit agufagit added the bug Something isn't working label Nov 2, 2024
@agufagit
Copy link
Author

agufagit commented Nov 2, 2024

confirmed it's not recognized inside begin; commit; block, but outside begin; commit; block, it's recognized, is this a bug for surrealdb itself?

@agufagit agufagit changed the title Bug: RecordID parameter is not recognized Bug: RecordID parameter is not recognized in transaction block Nov 2, 2024
@remade
Copy link
Collaborator

remade commented Nov 5, 2024

@agufagit The parameter as provided may not be passed correctly to the backend because the backend is not familiar with the default format it would get. Will make a PR update that "Stringifies" these type of parameters correctly. That should rectify this issue

@remade remade self-assigned this Nov 5, 2024
@agufagit
Copy link
Author

Hi @remade

When do you think these fixes will be done? If it's gonna be long, I'm gonna work on other tasks.

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants