1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-07 06:08:38 -04:00

tweaked to include the bundled SQLite library version (RT-107040)

This commit is contained in:
Kenichi Ishigaki 2016-01-11 18:27:10 +09:00
parent b494c77afc
commit 03dd9b486f
3 changed files with 32 additions and 2 deletions

View file

@ -974,6 +974,21 @@ on how to use DBI itself. The API works like every DBI module does.
However, currently many statement attributes are not implemented or
are limited by the typeless nature of the SQLite database.
=head1 SQLITE VERSION
DBD::SQLite is usually compiled with a bundled SQLite library
(SQLite version S<3.10.0> as of this release) for consistency.
However, a different version of SQLite may sometimes be used for
some reasons like security, or some new experimental features.
You can look at C<$DBD::SQLite::sqlite_version> (C<3.x.y> format) or
C<$DBD::SQLite::sqlite_version_number> (C<3xxxyyy> format)
to find which version of SQLite is actually used. You can also
check C<DBD::SQLite::Constants::SQLITE_VERSION_NUMBER()>.
You can also find how the library is compiled by calling
C<DBD::SQLite::compile_options()> (see below).
=head1 NOTABLE DIFFERENCES FROM OTHER DRIVERS
=head2 Database Name Is A File Name

View file

@ -2,12 +2,14 @@ package SQLiteUtil;
use strict;
use warnings;
use FindBin;
use Cwd;
use base 'Exporter';
use HTTP::Tiny;
use File::Copy;
our @EXPORT = qw/
extract_constants versions srcdir mirror copy_files
extract_constants versions srcdir mirror copy_files tweak_pod
check_api_history
/;
@ -279,6 +281,18 @@ sub copy_files {
copy("$dir/fts3_tokenizer.h", $ROOT);
}
sub tweak_pod {
my $version = shift;
my $dotted = $version->dotted;
my $pmfile = "$ROOT/lib/DBD/SQLite.pm";
my $body = do { open my $fh, '<', $pmfile or die $!; local $/; <$fh> };
$body =~ s/S<[\d\.]+>/S<$dotted>/g or die "Can't find a placeholder for SQLite version";
open my $out, '>', "$pmfile.tmp" or die $!;
print $out $body;
close $out;
rename "$pmfile.tmp" => $pmfile or die "Can't rename $pmfile.tmp to $pmfile: $!";
}
sub check_api_history {
require Array::Diff;
my %current;
@ -346,7 +360,7 @@ sub as_num {
sub dotted {
my $self = shift;
join '.', $self->[3] ? @$self : @$self[0..2];
join '.', map {$_ + 0} $self->[3] + 0 ? @$self : @$self[0..2];
}
sub year {

View file

@ -9,3 +9,4 @@ use SQLiteUtil;
my $version = SQLiteUtil::Version->new(shift || (versions())[-1]);
mirror($version);
copy_files($version);
tweak_pod($version);