-ident implementation
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / Oracle / Generic.pm
index 4d8b781..d976f38 100644 (file)
@@ -7,6 +7,8 @@ use Context::Preserve 'preserve_context';
 use Try::Tiny;
 use namespace::clean;
 
+__PACKAGE__->sql_limit_dialect ('RowNum');
+
 =head1 NAME
 
 DBIx::Class::Storage::DBI::Oracle::Generic - Oracle Support for DBIx::Class
@@ -46,7 +48,7 @@ DBIx::Class::Storage::DBI::Oracle::Generic - Oracle Support for DBIx::Class
   my $rs = $schema->resultset('Person')->search({},
     {
       'start_with' => { 'firstname' => 'foo', 'lastname' => 'bar' },
-      'connect_by' => { 'parentid' => { '-prior' => \'persionid' },
+      'connect_by' => { 'parentid' => { '-prior' => { -ident => 'personid' } },
       'order_siblings_by' => { -asc => 'name' },
     };
   );
@@ -60,7 +62,7 @@ DBIx::Class::Storage::DBI::Oracle::Generic - Oracle Support for DBIx::Class
   # START WITH
   #     firstname = 'foo' and lastname = 'bar'
   # CONNECT BY
-  #     parentid = prior persionid
+  #     parentid = prior personid
   # ORDER SIBLINGS BY
   #     firstname ASC
 
@@ -77,7 +79,7 @@ versions before 9.
 use base qw/DBIx::Class::Storage::DBI/;
 use mro 'c3';
 
-__PACKAGE__->sql_maker_class('DBIx::Class::SQLAHacks::Oracle');
+__PACKAGE__->sql_maker_class('DBIx::Class::SQLMaker::Oracle');
 
 sub deployment_statements {
   my $self = shift;;
@@ -146,7 +148,7 @@ sub _dbh_get_autoinc_seq {
   $sth->execute (@bind);
 
   while (my ($insert_trigger, $schema) = $sth->fetchrow_array) {
-    my ($seq_name) = $insert_trigger =~ m!("?[.\w"]+"?)\.nextval!i;
+    my ($seq_name) = $insert_trigger =~ m/("?[.\w"]+"?)\.nextval .+ into \s+ :new\.$col/xmsi;
 
     next unless $seq_name;