Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ap/dbix-simple-concrete
monkey-patch DBIx::Simple to use SQL::Concrete
https://github.com/ap/dbix-simple-concrete
dbix perl sql
Last synced: 4 days ago
JSON representation
monkey-patch DBIx::Simple to use SQL::Concrete
- Host: GitHub
- URL: https://github.com/ap/dbix-simple-concrete
- Owner: ap
- Created: 2015-01-10T07:53:23.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2022-09-01T22:06:28.000Z (over 2 years ago)
- Last Synced: 2024-11-06T03:03:56.090Z (about 2 months ago)
- Topics: dbix, perl, sql
- Language: Perl
- Homepage: https://metacpan.org/release/DBIx-Simple-Concrete
- Size: 9.77 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.pod
- Changelog: Changes
Awesome Lists containing this project
README
use 5.006; use strict; use warnings;
package DBIx::Simple::Concrete;
our $VERSION = '1.007';
use DBIx::Simple ();
use SQL::Concrete ();sub import {
shift;
my $prelude = sprintf qq'package %s;\n#line %d "%s"\n', ( caller )[0,2,1];
my $sub = eval qq{ sub { $prelude SQL::Concrete->import(\@_) } };
&$sub;
}sub cquery { shift->query( SQL::Concrete::Renderer->new->render( @_ ) ) }
die 'Too late to patch DBIx::Simple' if DBIx::Simple->can( 'cquery' );
*DBIx::Simple::cquery = \&cquery;
__END__
=pod
=encoding UTF-8
=head1 NAME
DBIx::Simple::Concrete - monkey-patch DBIx::Simple to use SQL::Concrete
=head1 SYNOPSIS
use DBIx::Simple::Concrete;
# ...
my $rows = $db->cquery( '
SELECT title
FROM threads
WHERE date >', \$date, '
AND', { subject => \@subjects }, '
' )->arrays;=head1 DESCRIPTION
The recommended way to use L is via its L
integration, which provides an excellent alternative to plain DBI access.But by loading this module instead (or after) L, a C
method will be added to it which integrates L just the same
way as its built-in C method integrates L.This is all there is to this module.
=cut