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

pq:escapeLiteral does it need conn-db? #18

Open
gnusupport opened this issue May 30, 2021 · 4 comments
Open

pq:escapeLiteral does it need conn-db? #18

gnusupport opened this issue May 30, 2021 · 4 comments

Comments

@gnusupport
Copy link

Does escaping really needs conn-db and why? Should not escaping be independent of connection?

Finally escaping function could be used to generate SQL without having a database connection.

@gnusupport
Copy link
Author

gnusupport commented May 30, 2021

(pq:escapeLiteral cf-db "\"") ⇒ "'\"'"
(sql-escape-string "\"") ⇒ "E'\"'"

I am using E'' notation, should not that be proper for pq:escapeLiteral in all cases? I remember some database warning appearing if there are escapes without E.

@gnusupport
Copy link
Author

(pq:escapeLiteral cf-db "\\\\\\\\") ⇒ " E'\\\\\\\\\\\\\\\\'"

I have noticed also that space before E, should it be?

@anse1
Copy link
Owner

anse1 commented May 31, 2021 via email

@gnusupport
Copy link
Author

gnusupport commented May 31, 2021 via 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