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

postgres: search w multiple values causes error SQLite only supports single value arguments #256

Closed
patricebender opened this issue Sep 28, 2023 · 1 comment
Labels
bug Something isn't working postgres

Comments

@patricebender
Copy link
Member

patricebender commented Sep 28, 2023

we get a sqlite specific error message for a search in postgres with multiple arguments.


In e.g. a bookshop, fire up a cds r --profile pg session:

❯ cds r --profile pg
Welcome to cds repl v7.3.0
> var { server } = cds.test()
> [cds] - loaded model from 5 file(s):

  srv/user-service.cds
  srv/cat-service.cds
  srv/admin-service.cds
  db/schema.cds
  ../../dev/cds/common.cds

[cds] - connect to db > postgres {
  url: ':memory:',
  host: 'localhost',
  port: 5432,
  user: 'postgres',
  password: '...',
  database: 'postgres'
}

and then:

> query = SELECT`from ${Books} {ID, title}`
Query {
  SELECT: {
    from: { ref: [ 'sap.capire.bookshop.Books' ] },
    columns: [ { ref: [ 'ID' ] }, { ref: [ 'title' ] } ]
  }
}
> query.SELECT.search = [{val: 'Wuthering'}, 'or', {val: 'Emily'}]
[ { val: 'Wuthering' }, 'or', { val: 'Emily' } ]
> await query
Uncaught SQLite only supports single value arguments for $search
@patricebender patricebender added bug Something isn't working postgres labels Sep 28, 2023
@patricebender
Copy link
Member Author

closing because already reported in #127

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working postgres
Projects
None yet
Development

No branches or pull requests

1 participant