will / crystal-pg

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

query_all missing first DB::ResultSet entry #202

Open carcinocron opened 4 years ago

carcinocron commented 4 years ago

What is the intended difference between query and query_all? I was using query_all then noticed that the first expected entry from the query was always missing. Changing to just query fixed this.

bcardiff commented 4 years ago

query_all should return an Array with one element per row query will yield a result set that you are responsible to iterate.

The documentation for such methods live in http://crystal-lang.github.io/crystal-db/api/latest/DB/QueryMethods.html

If you can share some small code to reproduce the unexpected behaviour we can see what might be happening.