I can't comment on your question regarding the disabling of package however I have spent some time trying to build an SQL DSL in Perl.
One issue you will likely face is dealing with things like "or" and "and" short-circuiting: as soon as Perl sees a true value on the left side of "or" or a false value on the left side of "and" it does not evaluate/execute the other term. Another issue is the flattening of "(" and ")" lists losing information you need to pass on to the database.
The best thing that I could come up with was parsing a list as special key/value pairs like so:
my $pinfo = $self->db->xhashref( select => [ 'n.id', 'p.hash' ], from => 'nodes n', inner_join => 'projects p', on => 'p.id = n.id', where => { 'n.uuid' => $uuid }, ); # Try and do this with an ORM! $dbw->xdo( insert_into => [ 'func_new_topic_status', qw/change_id id project_id tkind status rank def bill/, ], select => [ qv( $opts->{change_id} ), 'nextval("nodes")', qv( $opts->{id} ), 'ts.tkind', 'ts.status', 'ts.rank', 'ts.def', qv( $opts->{bill} // 1 ), ], from => 'topic_status ts', where => { 'ts.project_id' => $dup_pinfo->{id} }, order_by => [qw/ts.tkind ts.rank/] );
The DBIx::ThinSQL module contains my latest efforts. Unfortunately the documentation status is woefully wrong, but it functions (in my very humble opinion) far more powerfully and efficiently that any ORM or other SQL DSLs I've seen on CPAN.
In reply to Re: [DSL] disabling packages in Perl?
by mlawren
in thread [DSL] disabling packages in Perl?
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |