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

Supports array arguments in prepared statements #1892

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ritalin
Copy link

@ritalin ritalin commented Oct 11, 2024

Description

This PR implements in supporting an array arguments in the prepared statements (issue #447).

Usage

You can pass Javascript's array as argument for query / send method of AsyncPreparedStatement.

const stmt = await conn.prepare(`SELECT * FROM range(1, ?::int) t(id) WHERE id = ANY(?)`);
const result = await stmt.query(100, [2, 3, 5, 7, 11]); 

query / send method of PreparedStatement can also apply similarly.

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 this pull request may close these issues.

1 participant