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

Cant cast parameter to native types #180

Open
kim-anchorzero opened this issue Sep 5, 2024 · 0 comments · May be fixed by anchorzero/zapatos#17
Open

Cant cast parameter to native types #180

kim-anchorzero opened this issue Sep 5, 2024 · 0 comments · May be fixed by anchorzero/zapatos#17

Comments

@kim-anchorzero
Copy link

using db.param(value, 'type') where type is a string doesn't work for native types. The cast operation will be rejected with a "does not exist" error. This is due to core.ts:350 result.text += CAST(${placeholder} AS "${expression.cast}"); which wraps the cast with quotes. .

For example, db.param(1, 'bigint') will generate the fragment CAST(1 AS "bigint") which is not valid. For whatever reason "json" is a valid AS target but other types do not seem to work.

@kim-anchorzero kim-anchorzero linked a pull request Sep 16, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant