403Webshell
Server IP : 23.94.149.180  /  Your IP : 216.73.216.147
Web Server : nginx/1.20.1
System : Linux deadrock 5.14.0-741.22.1.el9_9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 12 15:18:14 UTC 2026 x86_64
User : apache ( 48)
PHP Version : 8.6.0
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /files/www/lawyerbabe/mblog/extlib/Data/ObjectDriver/Driver/DBD/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /files/www/lawyerbabe/mblog/extlib/Data/ObjectDriver/Driver/DBD/SQLite.pm
# $Id

package Data::ObjectDriver::Driver::DBD::SQLite;
use strict;
use warnings;
use base qw( Data::ObjectDriver::Driver::DBD );

use Data::ObjectDriver::Errors;

# yes according to http://www.sqlite.org/lang_replace.html 
sub can_replace { 1 }

sub fetch_id { $_[2]->func('last_insert_rowid') }

sub bind_param_attributes {
    my ($dbd, $data_type) = @_;
    if ($data_type) { 
        if ($data_type eq 'blob') {
            return DBI::SQL_BLOB;
        } elsif ($data_type eq 'binchar') {
            return DBI::SQL_BINARY;
        }
    }
    return;
}

sub map_error_code {
    my $dbd = shift;
    my($code, $msg) = @_;
    if ($msg && $msg =~ /not unique/) {
        return Data::ObjectDriver::Errors->UNIQUE_CONSTRAINT;
    } else {
        return;
    }
}


sub bulk_insert {
    my $dbd = shift;
    my $dbh = shift;
    my $table = shift;

    my $cols = shift;
    my $rows_ref = shift;

    my $sql = "INSERT INTO $table("  . join(',', @{$cols}) . ") VALUES (" . join(',',  map {'?'} @{$cols}) .  ")\n";

    my $sth = $dbh->prepare($sql);

    foreach my $row (@{$rows_ref}) {
	$sth->execute(@{$row});
    }

    # For now just write all data, at some point we need to lookup the
    # maximum packet size for SQL
    return 1;
}


1;

=pod

=head1 NAME

Data::ObjectDriver::Driver::DBD::SQLite - SQLite driver

=head2 DESCRIPTION

This class provides an interface to the SQLite (L<http://sqlite.org>)
database through DBI.

=head2 NOTES & BUGS

This is experimental.

With the 1.11 version of L<DBD::SQLite> Blobs are handled transparently,
so C<bind_param_attributes> is optionnal.
With previous version of L<DBD::SQLite> users have experimented issues
with binary data in CHAR (partially solved by the DBI::SQL_BINARY binding). 

=cut

Youez - 2016 - github.com/yon3zu
LinuXploit