Uname: Linux web3.us.cloudlogin.co 5.10.226-xeon-hst #2 SMP Fri Sep 13 12:28:44 UTC 2024 x86_64
Software: Apache
PHP version: 8.1.31 [ PHP INFO ] PHP os: Linux
Server Ip: 162.210.96.117
Your Ip: 3.147.103.204
User: edustar (269686) | Group: tty (888)
Safe Mode: OFF
Disable Function:
NONE

name : SQLite.pm
package DBIx::Connector::Driver::SQLite;

use strict;
use warnings;
use base 'DBIx::Connector::Driver';
our $VERSION = '0.56';

sub _connect {
    my ($self, $dbh, $dsn, $username, $password, $attrs) = @_;

    my ($x, $y, $z) = split /[.]/ => $dbh->{sqlite_version};
    $self->{_sqlite_is_new_enough} = (
        $x > 3 || (
            $x == 3 && ($y > 6 || (
                $y == 6 && $z >= 8
            ))
        )
    ) ? 1 : 0;
    return $dbh;
}

sub savepoint {
    my ($self, $dbh, $name) = @_;
    return unless $self->{_sqlite_is_new_enough};
    $dbh->do("SAVEPOINT $name");
}

sub release {
    my ($self, $dbh, $name) = @_;
    return unless $self->{_sqlite_is_new_enough};
    $dbh->do("RELEASE SAVEPOINT $name");
}

sub rollback_to {
    my ($self, $dbh, $name) = @_;
    return unless $self->{_sqlite_is_new_enough};
    $dbh->do("ROLLBACK TO SAVEPOINT $name");
}

1;
__END__

=head1 Name

DBIx::Connector::Driver::SQLite - SQLite-specific connection interface

=head1 Description

This subclass of L<DBIx::Connector::Driver|DBIx::Connector::Driver> provides
SQLite-specific implementations of the following methods:

=over

=item C<savepoint>

=item C<release>

=item C<rollback_to>

=back

Note that they only work with SQLite 3.6.8 or higher; older versions of SQLite
will fallback on the exception-throwing implementation of these methods in
L<DBIx::Connector::Driver|DBIx::Connector::Driver>.

=head1 Authors

This module was written and is maintained by:

=over

=item David E. Wheeler <david@kineticode.com>

=back

=head1 Copyright and License

Copyright (c) 2009-2013 David E. Wheeler. Some Rights Reserved.

This module is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.

=cut
© 2025 GrazzMean