Skip to content

format Array values #4

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

Open
webdeb opened this issue Apr 26, 2020 · 1 comment
Open

format Array values #4

webdeb opened this issue Apr 26, 2020 · 1 comment

Comments

@webdeb
Copy link

webdeb commented Apr 26, 2020

It does seem, that format cannot deal with postgres array columns, am I right?

A query like:

format("INSERT into posts ?", { title: "New Post", tags: ["foo", "bar"]})

Is not working properly.

A possible workaround is to escape each of the tags separately and use:

format("INSERT into posts ?", { title: "New Post", "!tags": "{" + ["foo", "bar"].map(escape).join(",") + "}")
@patrickpissurno
Copy link
Owner

That's right. I'll look into it. Sorry for the delay, I didn't receive a notification.

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