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

paginate_by_sql fails when using different databases #117

Closed
fabiob opened this issue Mar 22, 2011 · 1 comment
Closed

paginate_by_sql fails when using different databases #117

fabiob opened this issue Mar 22, 2011 · 1 comment

Comments

@fabiob
Copy link

fabiob commented Mar 22, 2011

My rails application, on my development environment, runs on SQLite, but access some legacy Oracle database (using ActiveRecord::Base.establish_connection on the legacy models).

Since it's a legacy database, used mostly for querying, I use find_by_sql a lot. I started working with will_paginate on some queries, switched my calls to find_by_sql for paginate_by_sql, but Oracle started complaining about SQL syntax errors.

Digging through the logs, I noticed that will_paginate added 'LIMIT 20 OFFSET 20' to my query - the SQLite way of pagination. Looks like it's trying to use the adapter configured for ActiveRecord::Base, and not for my additional model.

@mislav
Copy link
Owner

mislav commented May 10, 2021

Sorry, our paginate_by_sql support is really limited on other database adapters. I'm afraid you will have to write your own pagination and count queries for Oracle.

@mislav mislav closed this as completed May 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants