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

Mojo::Pg fails to load when SQL::Abstract cannot be found #83

Open
s1037989 opened this issue Nov 23, 2021 · 2 comments
Open

Mojo::Pg fails to load when SQL::Abstract cannot be found #83

s1037989 opened this issue Nov 23, 2021 · 2 comments

Comments

@s1037989
Copy link

  • Mojo::Pg version: 4.26
  • Perl version: 5.30.1
  • Operating system: RHEL 7.9

Steps to reproduce the behavior

use Mojo::Pg; fails if SQL::Abstract isn't available.

Expected behavior

Because SQL::Abstract isn't strictly required (or doesn't need to be) Mojo::Pg should not fail if Abstract cannot be found.

Actual behavior

Mojo::Pg fails to load of SQL::Abstract cannot be found.

Possible solution

Make loading it optional, kind of like how Net::DNS::Native and a few others are optional for Mojolicious. When SQL::Abstract cannot be found and isn't loaded, the abstract attribute isn't set, and the convenience methods in Mojo::Pg::Database are not created with monkey_patch.

@kraih
Copy link
Member

kraih commented Nov 23, 2021

👎 Too much core Mojo::Pg functionality would not work without it.

@s1037989
Copy link
Author

Wow, really? I searched all over the source for abstract, select, insert, update, and delete and no hits looked essential.

Obviously you know better than me! But would you be willing to link me to an example in the source that depends on it?

FWIW, I even successfully ran the synopsis of Minion with the Mojo::Pg backend and use SQL::Abstract; commented out in Mojo::Pg.

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