Skip to content
This repository has been archived by the owner on May 10, 2020. It is now read-only.

Parameters: Equivalent of JDBC's setArray() #98

Open
nevi-me opened this issue Mar 27, 2019 · 4 comments
Open

Parameters: Equivalent of JDBC's setArray() #98

nevi-me opened this issue Mar 27, 2019 · 4 comments

Comments

@nevi-me
Copy link

nevi-me commented Mar 27, 2019

I'm trying to run something like:

select * from roles where role_group in ('a', 'b', 'c');

Is there a way of running?

connection.query(
    "SELECT * FROM roles WHERE role_group in @P1",
    &[???]
)
@steffengy
Copy link
Owner

No not currently.
The closest would be to manually unroll and build IN(@P1, @P2, ...) as SQL and then pass multiple parameters.

@nevi-me
Copy link
Author

nevi-me commented Mar 28, 2019

I'll use a manual unroll for now, but it's something I'd like to work on with some guidance. Can you point me in the right direction? I can work on this in the coming days/weeks

@steffengy
Copy link
Owner

@o01eg
Copy link

o01eg commented Mar 29, 2019

There setStructured which accepts SQLServerDataTable. But it requires to define type in the database.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants