Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Unable to perform a SELECT WHERE IN (...) #118

Closed
mhuggins opened this Issue Sep 9, 2012 · 3 comments

Comments

Projects
None yet
2 participants
Contributor

mhuggins commented Sep 9, 2012

I'm trying to selected multiple records matching a collection of ID's, e.g.:

ids = [1, 3, 5, 7, 9];
User.all({ where: { id: ids } }, function (err, users) {
  console.log('Error:', err);
  console.log('Users:', users);
});

I'm getting the following output for err:

Error: { [error: syntax error at or near ","]
  length: 79,
  name: 'error',
  severity: 'ERROR',
  code: '42601',
  detail: undefined,
  hint: undefined,
  position: '33',
  internalPosition: undefined,
  internalQuery: undefined,
  where: undefined,
  file: 'scan.l',
  line: '907',
  routine: 'base_yyerror' }
Owner

1602 commented Sep 9, 2012

I can assume {id: ids} is not valid query. Use {id: {in: ids}} instead.

On Mon, Sep 10, 2012 at 1:14 AM, Matt Huggins notifications@github.comwrote:

I'm trying to selected multiple records matching a collection of ID's,
e.g.:

ids = [1, 3, 5, 7, 9];
User.all({ where: { id: ids } }, function (err, users) {
console.log('Error:', err);
console.log('Users:', users);
});

I'm getting the following output for err:

Error: { [error: syntax error at or near ","]
length: 79,
name: 'error',
severity: 'ERROR',
code: '42601',
detail: undefined,
hint: undefined,
position: '33',
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
file: 'scan.l',
line: '907',
routine: 'base_yyerror' }


Reply to this email directly or view it on GitHubhttps://github.com/1602/jugglingdb/issues/118.

Thanks,
Anatoliy Chakkaev

Contributor

mhuggins commented Sep 9, 2012

Unfortunately that results in the same error still.

Contributor

mhuggins commented Sep 9, 2012

Ahh, crap. I see the problem. Jugglingdb currently only supports gt, gte, lt, lte, & between for postgres, while inq, nin, & neq are supported by mysql only.

@1602 1602 closed this Jan 22, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment