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

Cannot use IEnumberable<T> parameters #222

Closed
danzel opened this issue May 1, 2014 · 1 comment
Closed

Cannot use IEnumberable<T> parameters #222

danzel opened this issue May 1, 2014 · 1 comment
Labels

Comments

@danzel
Copy link
Contributor

danzel commented May 1, 2014

We're looking at upgrading from a custom built 2.0.11 version of Npgsql to the latest and greatest and we ran in to this issue:

var comm = conn.CreateCommand();
comm.CommandText = "SELECT :something";
comm.Parameters.AddWithValue("something", new[] { 1, 2, 3 }.Select(x => x)); //Parameter is an IEnumerable<int>
var res = comm.ExecuteScalar();

Previously this would work, now it generates invalid SQL for the parameter.

Bad (IEnumerable):
SELECT (('[1,2,3]')::int4[])

Good (Using an Array):
SELECT (('{1,2,3}')::int4[])

I might take a quick look through to see if I can fix this, no promises however :)

@franciscojunior
Copy link
Member

We had a lot of changes about array handling. I think we may have break something... :( Sorry for that.

I'll have a look at this.

Thanks for your feedback!

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

No branches or pull requests

2 participants