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

periods in string split string #987

Open
bobbymannino opened this issue Nov 24, 2024 · 1 comment
Open

periods in string split string #987

bobbymannino opened this issue Nov 24, 2024 · 1 comment

Comments

@bobbymannino
Copy link

if you have a string "[email protected]" no matter how you insert it;

"sqlcall new_user(${email})"
"sqlcall new_user(${sql(email)})"

I end up with the sql call new_user ("bonobo"."bob@bom"."com")

Why is this happening? im sure its me but I cant figure out why?

@chiuwah
Copy link

chiuwah commented Dec 3, 2024

If you put the email in an object and then insert it in the sql request, it should work:

const user = { email: '[email protected]' }

await sql`insert into users ${ sql(user, 'email') }`

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

2 participants