Grinnz / Mojo-SQLite

Mojo::SQLite - A tiny Mojolicious wrapper for SQLite
https://metacpan.org/pod/Mojo::SQLite
Other
27 stars 12 forks source link

Bug: Mojo::SQLite->new(abstract => ...) does not work #16

Closed augensalat closed 4 years ago

augensalat commented 4 years ago

Documentation tells that you can set an SQL::Abstract class like this:

my $sql = Mojo::SQLite->new(abstract => SQL::Abstract::Pg->new(name_sep => '.', quote_char => '"'));

This does not work! Proof:

perl -MMojo::SQLite -MSQL::Abstract::Pg -wE 'my $sql = Mojo::SQLite->new(abstract => SQL::Abstract::Pg->new(name_sep => q(.), quote_char => q("))); say ref($sql->abstract)'

Workaround:

perl -MMojo::SQLite -MSQL::Abstract::Pg -wE 'my $sql = Mojo::SQLite->new; $sql->abstract(SQL::Abstract::Pg->new(name_sep => q(.), quote_char => q("))); say ref($sql->abstract)'
Grinnz commented 4 years ago

Good catch, the Mojo::SQLite constructor does not accept attributes.