Why am I unable to query my sqlite db?

Compatible grouped query for PostgreSQL and sqlite?

  • I'm making kind of "popular bookmarks" with RoR. I wrote query below. Bookmark.select("*, count('item_id') AS cnt").group("item_id").order("cnt DESC").limit(60) It works on local sqlite3 server but doesn't work on heroku postgreSQL environment. I heard group query doesn't have compatibility but don't know how to fix. any ideas?

  • Answer:

    Using the same database technology in ideally the exact same version is preferable over testing that queries work the same in two databases. Getting Postgres to run locally is not that hard. If you are on a Mac, try Postgres.app [1], for other platforms see [2]. [1]: http://postgresapp.com/ [2]: https://devcenter.heroku.com/articles/local-postgresql

Thomas Klemm at Quora Visit the source

Was this solution helpful to you?

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.