will / crystal-pg

a postgres driver for crystal
BSD 3-Clause "New" or "Revised" License
462 stars 77 forks source link

Support for full text search #194

Closed repomaa closed 4 years ago

repomaa commented 4 years ago

I noticed that trying to execute the following query fails with a syntax error:

db.query_all(
  "SELECT * FROM log_messages WHERE ts_message @@ websearch_to_tsquery(?)",
  to: MyModel,
  args: ["foo"]
)

# => Unhandled exception: syntax error at or near ")" (PQ::PQError)
asterite commented 4 years ago

Maybe ? must be $1? That's the syntax for placeholders in postgresql.

repomaa commented 4 years ago

Yeah... sorry bout that :D