Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package perl-Mojo-SQLite for
openSUSE:Factory checked in at 2021-08-03 22:48:51
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Mojo-SQLite (Old)
and /work/SRC/openSUSE:Factory/.perl-Mojo-SQLite.new.1899 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "perl-Mojo-SQLite"
Tue Aug 3 22:48:51 2021 rev:13 rq:909911 version:3.007
Changes:
--------
--- /work/SRC/openSUSE:Factory/perl-Mojo-SQLite/perl-Mojo-SQLite.changes
2021-06-29 22:44:07.822942586 +0200
+++
/work/SRC/openSUSE:Factory/.perl-Mojo-SQLite.new.1899/perl-Mojo-SQLite.changes
2021-08-03 22:49:21.628452019 +0200
@@ -1,0 +2,14 @@
+Mon Aug 2 03:08:53 UTC 2021 - Tina M??ller <[email protected]>
+
+- updated to 3.007
+ see /usr/share/doc/packages/perl-Mojo-SQLite/Changes
+
+ 3.007 2021-08-01 20:17:42 EDT
+ - Increase DBD::SQLite dependency to 1.68 to support and use
sqlite_string_mode over sqlite_unicode (#22, Adam Williamson)
+ - The default options now set sqlite_string_mode to
DBD_SQLITE_STRING_MODE_UNICODE_FALLBACK,
+ unless sqlite_unicode is specified explicitly in from_string or
from_filename. This is equivalent
+ to the previous behavior but ensures that DBD::SQLite will not return
malformed strings.
+ - Support wal_mode option to enable WAL journaling mode, which is still
currently the default,
+ but may not be set by default in a future release.
+
+-------------------------------------------------------------------
Old:
----
Mojo-SQLite-3.006.tar.gz
New:
----
Mojo-SQLite-3.007.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ perl-Mojo-SQLite.spec ++++++
--- /var/tmp/diff_new_pack.OP0pH0/_old 2021-08-03 22:49:22.084451469 +0200
+++ /var/tmp/diff_new_pack.OP0pH0/_new 2021-08-03 22:49:22.088451464 +0200
@@ -18,7 +18,7 @@
%define cpan_name Mojo-SQLite
Name: perl-Mojo-SQLite
-Version: 3.006
+Version: 3.007
Release: 0
Summary: Tiny Mojolicious wrapper for SQLite
License: Artistic-2.0
@@ -28,7 +28,7 @@
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl-macros
-BuildRequires: perl(DBD::SQLite) >= 1.64
+BuildRequires: perl(DBD::SQLite) >= 1.68
BuildRequires: perl(DBI) >= 1.627
BuildRequires: perl(Module::Build::Tiny) >= 0.034
BuildRequires: perl(Module::Metadata)
@@ -38,7 +38,7 @@
BuildRequires: perl(URI) >= 1.69
BuildRequires: perl(URI::db) >= 0.15
BuildRequires: perl(URI::file) >= 4.21
-Requires: perl(DBD::SQLite) >= 1.64
+Requires: perl(DBD::SQLite) >= 1.68
Requires: perl(DBI) >= 1.627
Requires: perl(Mojolicious) >= 8.03
Requires: perl(SQL::Abstract::Pg) >= 1.0
++++++ Mojo-SQLite-3.006.tar.gz -> Mojo-SQLite-3.007.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-SQLite-3.006/Build.PL
new/Mojo-SQLite-3.007/Build.PL
--- old/Mojo-SQLite-3.006/Build.PL 2021-06-16 06:30:50.000000000 +0200
+++ new/Mojo-SQLite-3.007/Build.PL 2021-08-02 02:17:44.000000000 +0200
@@ -68,7 +68,7 @@
}
- # This section was automatically generated by
Dist::Zilla::Plugin::ModuleBuild v6.017.
+ # This section was automatically generated by
Dist::Zilla::Plugin::ModuleBuild v6.022.
use strict;
use warnings;
@@ -84,13 +84,13 @@
"Dan Book <dbook\@cpan.org>"
],
"dist_name" => "Mojo-SQLite",
- "dist_version" => "3.006",
+ "dist_version" => "3.007",
"license" => "artistic_2",
"module_name" => "Mojo::SQLite",
"recursive_test_files" => 1,
"requires" => {
"Carp" => 0,
- "DBD::SQLite" => "1.64",
+ "DBD::SQLite" => "1.68",
"DBI" => "1.627",
"File::Spec::Functions" => 0,
"File::Temp" => 0,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-SQLite-3.006/Changes
new/Mojo-SQLite-3.007/Changes
--- old/Mojo-SQLite-3.006/Changes 2021-06-16 06:30:50.000000000 +0200
+++ new/Mojo-SQLite-3.007/Changes 2021-08-02 02:17:44.000000000 +0200
@@ -1,3 +1,11 @@
+3.007 2021-08-01 20:17:42 EDT
+ - Increase DBD::SQLite dependency to 1.68 to support and use
sqlite_string_mode over sqlite_unicode (#22, Adam Williamson)
+ - The default options now set sqlite_string_mode to
DBD_SQLITE_STRING_MODE_UNICODE_FALLBACK,
+ unless sqlite_unicode is specified explicitly in from_string or
from_filename. This is equivalent
+ to the previous behavior but ensures that DBD::SQLite will not return
malformed strings.
+ - Support wal_mode option to enable WAL journaling mode, which is still
currently the default,
+ but may not be set by default in a future release.
+
3.006 2021-06-16 00:30:47 EDT
- Set default abstract generator to an SQL::Abstract::Pg object, enabling
additional features.
- Update IRC metadata to libera.chat
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-SQLite-3.006/MANIFEST
new/Mojo-SQLite-3.007/MANIFEST
--- old/Mojo-SQLite-3.006/MANIFEST 2021-06-16 06:30:50.000000000 +0200
+++ new/Mojo-SQLite-3.007/MANIFEST 2021-08-02 02:17:44.000000000 +0200
@@ -1,4 +1,4 @@
-# This file was automatically generated by Dist::Zilla::Plugin::Manifest
v6.017.
+# This file was automatically generated by Dist::Zilla::Plugin::Manifest
v6.022.
Build.PL
CONTRIBUTING.md
Changes
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-SQLite-3.006/META.json
new/Mojo-SQLite-3.007/META.json
--- old/Mojo-SQLite-3.006/META.json 2021-06-16 06:30:50.000000000 +0200
+++ new/Mojo-SQLite-3.007/META.json 2021-08-02 02:17:44.000000000 +0200
@@ -4,7 +4,7 @@
"Dan Book <[email protected]>"
],
"dynamic_config" : 0,
- "generated_by" : "Dist::Zilla version 6.017, CPAN::Meta::Converter version
2.150010",
+ "generated_by" : "Dist::Zilla version 6.022, CPAN::Meta::Converter version
2.150010",
"license" : [
"artistic_2"
],
@@ -39,7 +39,7 @@
"runtime" : {
"requires" : {
"Carp" : "0",
- "DBD::SQLite" : "1.64",
+ "DBD::SQLite" : "1.68",
"DBI" : "1.627",
"File::Spec::Functions" : "0",
"File::Temp" : "0",
@@ -66,28 +66,28 @@
"provides" : {
"Mojo::SQLite" : {
"file" : "lib/Mojo/SQLite.pm",
- "version" : "3.006"
+ "version" : "3.007"
},
"Mojo::SQLite::Database" : {
"file" : "lib/Mojo/SQLite/Database.pm",
- "version" : "3.006"
+ "version" : "3.007"
},
"Mojo::SQLite::Migrations" : {
"file" : "lib/Mojo/SQLite/Migrations.pm",
- "version" : "3.006"
+ "version" : "3.007"
},
"Mojo::SQLite::PubSub" : {
"file" : "lib/Mojo/SQLite/PubSub.pm",
- "version" : "3.006",
+ "version" : "3.007",
"x_deprecated" : 1
},
"Mojo::SQLite::Results" : {
"file" : "lib/Mojo/SQLite/Results.pm",
- "version" : "3.006"
+ "version" : "3.007"
},
"Mojo::SQLite::Transaction" : {
"file" : "lib/Mojo/SQLite/Transaction.pm",
- "version" : "3.006"
+ "version" : "3.007"
}
},
"release_status" : "stable",
@@ -103,8 +103,9 @@
},
"x_IRC" : "ircs://irc.libera.chat/#mojo"
},
- "version" : "3.006",
+ "version" : "3.007",
"x_contributors" : [
+ "Adam Williamson <[email protected]>",
"Dan Book <[email protected]>",
"Dan Book <[email protected]>",
"Stefan Adams <[email protected]>"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-SQLite-3.006/META.yml
new/Mojo-SQLite-3.007/META.yml
--- old/Mojo-SQLite-3.006/META.yml 2021-06-16 06:30:50.000000000 +0200
+++ new/Mojo-SQLite-3.007/META.yml 2021-08-02 02:17:44.000000000 +0200
@@ -9,7 +9,7 @@
configure_requires:
Module::Build::Tiny: '0.034'
dynamic_config: 0
-generated_by: 'Dist::Zilla version 6.017, CPAN::Meta::Converter version
2.150010'
+generated_by: 'Dist::Zilla version 6.022, CPAN::Meta::Converter version
2.150010'
license: artistic_2
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -26,26 +26,26 @@
provides:
Mojo::SQLite:
file: lib/Mojo/SQLite.pm
- version: '3.006'
+ version: '3.007'
Mojo::SQLite::Database:
file: lib/Mojo/SQLite/Database.pm
- version: '3.006'
+ version: '3.007'
Mojo::SQLite::Migrations:
file: lib/Mojo/SQLite/Migrations.pm
- version: '3.006'
+ version: '3.007'
Mojo::SQLite::PubSub:
file: lib/Mojo/SQLite/PubSub.pm
- version: '3.006'
+ version: '3.007'
x_deprecated: 1
Mojo::SQLite::Results:
file: lib/Mojo/SQLite/Results.pm
- version: '3.006'
+ version: '3.007'
Mojo::SQLite::Transaction:
file: lib/Mojo/SQLite/Transaction.pm
- version: '3.006'
+ version: '3.007'
requires:
Carp: '0'
- DBD::SQLite: '1.64'
+ DBD::SQLite: '1.68'
DBI: '1.627'
File::Spec::Functions: '0'
File::Temp: '0'
@@ -61,8 +61,9 @@
bugtracker: https://github.com/Grinnz/Mojo-SQLite/issues
homepage: https://github.com/Grinnz/Mojo-SQLite
repository: https://github.com/Grinnz/Mojo-SQLite.git
-version: '3.006'
+version: '3.007'
x_contributors:
+ - 'Adam Williamson <[email protected]>'
- 'Dan Book <[email protected]>'
- 'Dan Book <[email protected]>'
- 'Stefan Adams <[email protected]>'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-SQLite-3.006/README new/Mojo-SQLite-3.007/README
--- old/Mojo-SQLite-3.006/README 2021-06-16 06:30:50.000000000 +0200
+++ new/Mojo-SQLite-3.007/README 2021-08-02 02:17:44.000000000 +0200
@@ -93,20 +93,25 @@
method "hash" in Mojo::SQLite::Results to retrieve the first row as a
hash reference.
- All I/O and queries are performed synchronously. However, the
- "Write-Ahead Log" journal is enabled for all connections, allowing
- multiple processes to read and write concurrently to the same database
- file (but only one can write at a time). You can prevent this mode from
- being enabled by passing the option no_wal, but note that this is
- incompatible with SQLite databases that have already had WAL mode
- enabled. See http://sqlite.org/wal.html and "journal_mode" in
- DBD::SQLite for more information.
+ All I/O and queries are performed synchronously, and SQLite's default
+ journal mode only supports concurrent reads from multiple processes
+ while the database is not being written. The "Write-Ahead Log" journal
+ mode allows multiple processes to read and write concurrently to the
+ same database file (but only one can write at a time). WAL mode is
+ enabled by the wal_mode option, currently enabled by default, and
+ persists when opening that same database in the future.
- # Performed concurrently
+ # Performed concurrently (concurrent with writing only with WAL
journaling mode)
my $pid = fork || die $!;
say $sql->db->query(q{select datetime('now','localtime') as
time})->hash->{time};
exit unless $pid;
+ The no_wal option prevents WAL mode from being enabled in new databases
+ but doesn't affect databases where it has already been enabled.
+ wal_mode may not be set by default in a future release. See
+ http://sqlite.org/wal.html and "journal_mode" in DBD::SQLite for more
+ information.
+
The double-quoted string literal misfeature
<https://sqlite.org/quirks.html#double_quoted_string_literals_are_accepted>
is disabled for all connections since Mojo::SQLite 3.003; use single
@@ -233,12 +238,13 @@
my $options = $sql->options;
$sql = $sql->options({AutoCommit => 1, RaiseError => 1});
- Options for database handles, defaults to activating sqlite_unicode,
- AutoCommit, AutoInactiveDestroy as well as RaiseError and deactivating
- PrintError. Note that AutoCommit and RaiseError are considered
- mandatory, so deactivating them would be very dangerous. See
- "ATTRIBUTES COMMON TO ALL HANDLES" in DBI and "DRIVER PRIVATE
- ATTRIBUTES" in DBD::SQLite for more information on available options.
+ Options for database handles, defaults to setting sqlite_string_mode to
+ DBD_SQLITE_STRING_MODE_UNICODE_FALLBACK, setting AutoCommit,
+ AutoInactiveDestroy and RaiseError, and deactivating PrintError. Note
+ that AutoCommit and RaiseError are considered mandatory, so
+ deactivating them would be very dangerous. See "ATTRIBUTES COMMON TO
+ ALL HANDLES" in DBI and "DRIVER PRIVATE ATTRIBUTES" in DBD::SQLite for
+ more information on available options.
parent
@@ -310,6 +316,10 @@
# Readonly connection without WAL mode
$sql->from_filename($filename, { ReadOnly => 1, no_wal => 1 });
+
+ # Strict unicode strings and WAL mode
+ use DBD::SQLite::Constants ':dbd_sqlite_string_mode';
+ $sql->from_filename($filename, { sqlite_string_mode =>
DBD_SQLITE_STRING_MODE_UNICODE_STRICT, wal_mode => 1 });
from_string
@@ -363,6 +373,11 @@
# Readonly connection without WAL mode
$sql->from_string('data.db?ReadOnly=1&no_wal=1');
+
+ # String unicode strings and WAL mode
+ use DBD::SQLite::Constants ':dbd_sqlite_string_mode';
+ $sql->from_string(Mojo::URL->new->scheme('sqlite')->path('data.db')
+ ->query(sqlite_string_mode => DBD_SQLITE_STRING_MODE_UNICODE_STRICT,
wal_mode => 1));
DEBUGGING
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-SQLite-3.006/lib/Mojo/SQLite/Database.pm
new/Mojo-SQLite-3.007/lib/Mojo/SQLite/Database.pm
--- old/Mojo-SQLite-3.006/lib/Mojo/SQLite/Database.pm 2021-06-16
06:30:50.000000000 +0200
+++ new/Mojo-SQLite-3.007/lib/Mojo/SQLite/Database.pm 2021-08-02
02:17:44.000000000 +0200
@@ -9,7 +9,7 @@
use Mojo::SQLite::Transaction;
use Mojo::Util 'monkey_patch';
-our $VERSION = '3.006';
+our $VERSION = '3.007';
our @CARP_NOT = qw(Mojo::SQLite::Migrations);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-SQLite-3.006/lib/Mojo/SQLite/Migrations.pm
new/Mojo-SQLite-3.007/lib/Mojo/SQLite/Migrations.pm
--- old/Mojo-SQLite-3.006/lib/Mojo/SQLite/Migrations.pm 2021-06-16
06:30:50.000000000 +0200
+++ new/Mojo-SQLite-3.007/lib/Mojo/SQLite/Migrations.pm 2021-08-02
02:17:44.000000000 +0200
@@ -8,7 +8,7 @@
use constant DEBUG => $ENV{MOJO_MIGRATIONS_DEBUG} || 0;
-our $VERSION = '3.006';
+our $VERSION = '3.007';
has name => 'migrations';
has sqlite => undef, weak => 1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-SQLite-3.006/lib/Mojo/SQLite/PubSub.pm
new/Mojo-SQLite-3.007/lib/Mojo/SQLite/PubSub.pm
--- old/Mojo-SQLite-3.006/lib/Mojo/SQLite/PubSub.pm 2021-06-16
06:30:50.000000000 +0200
+++ new/Mojo-SQLite-3.007/lib/Mojo/SQLite/PubSub.pm 2021-08-02
02:17:44.000000000 +0200
@@ -3,7 +3,7 @@
use Mojo::Util 'deprecated';
-our $VERSION = '3.006';
+our $VERSION = '3.007';
deprecated 'Mojo::SQLite::PubSub is deprecated and should no longer be used';
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-SQLite-3.006/lib/Mojo/SQLite/Results.pm
new/Mojo-SQLite-3.007/lib/Mojo/SQLite/Results.pm
--- old/Mojo-SQLite-3.006/lib/Mojo/SQLite/Results.pm 2021-06-16
06:30:50.000000000 +0200
+++ new/Mojo-SQLite-3.007/lib/Mojo/SQLite/Results.pm 2021-08-02
02:17:44.000000000 +0200
@@ -5,7 +5,7 @@
use Mojo::JSON 'from_json';
use Mojo::Util 'tablify';
-our $VERSION = '3.006';
+our $VERSION = '3.007';
has [qw(db sth)];
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-SQLite-3.006/lib/Mojo/SQLite/Transaction.pm
new/Mojo-SQLite-3.007/lib/Mojo/SQLite/Transaction.pm
--- old/Mojo-SQLite-3.006/lib/Mojo/SQLite/Transaction.pm 2021-06-16
06:30:50.000000000 +0200
+++ new/Mojo-SQLite-3.007/lib/Mojo/SQLite/Transaction.pm 2021-08-02
02:17:44.000000000 +0200
@@ -3,7 +3,7 @@
use Carp 'croak';
-our $VERSION = '3.006';
+our $VERSION = '3.007';
has db => undef, weak => 1;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-SQLite-3.006/lib/Mojo/SQLite.pm
new/Mojo-SQLite-3.007/lib/Mojo/SQLite.pm
--- old/Mojo-SQLite-3.006/lib/Mojo/SQLite.pm 2021-06-16 06:30:50.000000000
+0200
+++ new/Mojo-SQLite-3.007/lib/Mojo/SQLite.pm 2021-08-02 02:17:44.000000000
+0200
@@ -4,7 +4,7 @@
use Carp 'croak';
use DBI;
use DBD::SQLite;
-use DBD::SQLite::Constants ':database_connection_configuration_options';
+use DBD::SQLite::Constants qw(:database_connection_configuration_options
:dbd_sqlite_string_mode);
use File::Spec::Functions 'catfile';
use File::Temp;
use Mojo::SQLite::Database;
@@ -14,7 +14,7 @@
use URI;
use URI::db;
-our $VERSION = '3.006';
+our $VERSION = '3.007';
has abstract => sub { SQL::Abstract::Pg->new(name_sep => '.', quote_char =>
'"') };
has 'auto_migrate';
@@ -28,7 +28,8 @@
AutoInactiveDestroy => 1,
PrintError => 0,
RaiseError => 1,
- sqlite_unicode => 1,
+ sqlite_string_mode => DBD_SQLITE_STRING_MODE_UNICODE_FALLBACK,
+ wal_mode => 1,
};
};
has 'parent';
@@ -49,6 +50,8 @@
# Options
my %options = $url->query_form;
$url->query(undef);
+ # don't set default string_mode if sqlite_unicode legacy option is set
+ delete $self->options->{sqlite_string_mode} if exists
$options{sqlite_unicode};
@{$self->options}{keys %options} = values %options;
# Parse URL based on scheme
@@ -81,7 +84,7 @@
// croak "DBI connection to @{[$self->dsn]} failed: $DBI::errstr"; #
RaiseError disabled
$dbh->sqlite_db_config(SQLITE_DBCONFIG_DQS_DDL, 0);
$dbh->sqlite_db_config(SQLITE_DBCONFIG_DQS_DML, 0);
- unless ($self->options->{no_wal}) {
+ if ($self->options->{wal_mode} and !$self->options->{no_wal}) {
$dbh->do('pragma journal_mode=WAL');
$dbh->do('pragma synchronous=NORMAL');
}
@@ -222,19 +225,24 @@
the method L<Mojo::SQLite::Results/"hash"> to retrieve the first row as a hash
reference.
-All I/O and queries are performed synchronously. However, the "Write-Ahead Log"
-journal is enabled for all connections, allowing multiple processes to read and
-write concurrently to the same database file (but only one can write at a
-time). You can prevent this mode from being enabled by passing the option
-C<no_wal>, but note that this is incompatible with SQLite databases that have
-already had WAL mode enabled. See L<http://sqlite.org/wal.html> and
-L<DBD::SQLite/"journal_mode"> for more information.
+All I/O and queries are performed synchronously, and SQLite's default journal
+mode only supports concurrent reads from multiple processes while the database
+is not being written. The "Write-Ahead Log" journal mode allows multiple
+processes to read and write concurrently to the same database file (but only
+one can write at a time). WAL mode is enabled by the C<wal_mode> option,
+currently enabled by default, and persists when opening that same database in
+the future.
- # Performed concurrently
+ # Performed concurrently (concurrent with writing only with WAL journaling
mode)
my $pid = fork || die $!;
say $sql->db->query(q{select datetime('now','localtime') as
time})->hash->{time};
exit unless $pid;
+The C<no_wal> option prevents WAL mode from being enabled in new databases but
+doesn't affect databases where it has already been enabled. C<wal_mode> may not
+be set by default in a future release. See L<http://sqlite.org/wal.html> and
+L<DBD::SQLite/"journal_mode"> for more information.
+
The L<double-quoted string literal misfeature
|https://sqlite.org/quirks.html#double_quoted_string_literals_are_accepted> is
disabled for all connections since Mojo::SQLite 3.003; use single quotes for
@@ -359,10 +367,11 @@
my $options = $sql->options;
$sql = $sql->options({AutoCommit => 1, RaiseError => 1});
-Options for database handles, defaults to activating C<sqlite_unicode>,
-C<AutoCommit>, C<AutoInactiveDestroy> as well as C<RaiseError> and deactivating
-C<PrintError>. Note that C<AutoCommit> and C<RaiseError> are considered
-mandatory, so deactivating them would be very dangerous. See
+Options for database handles, defaults to setting C<sqlite_string_mode> to
+C<DBD_SQLITE_STRING_MODE_UNICODE_FALLBACK>, setting C<AutoCommit>,
+C<AutoInactiveDestroy> and C<RaiseError>, and deactivating C<PrintError>.
+Note that C<AutoCommit> and C<RaiseError> are considered mandatory, so
+deactivating them would be very dangerous. See
L<DBI/"ATTRIBUTES COMMON TO ALL HANDLES"> and
L<DBD::SQLite/"DRIVER PRIVATE ATTRIBUTES"> for more information on available
options.
@@ -436,6 +445,10 @@
# Readonly connection without WAL mode
$sql->from_filename($filename, { ReadOnly => 1, no_wal => 1 });
+
+ # Strict unicode strings and WAL mode
+ use DBD::SQLite::Constants ':dbd_sqlite_string_mode';
+ $sql->from_filename($filename, { sqlite_string_mode =>
DBD_SQLITE_STRING_MODE_UNICODE_STRICT, wal_mode => 1 });
=head2 from_string
@@ -490,6 +503,11 @@
# Readonly connection without WAL mode
$sql->from_string('data.db?ReadOnly=1&no_wal=1');
+ # String unicode strings and WAL mode
+ use DBD::SQLite::Constants ':dbd_sqlite_string_mode';
+ $sql->from_string(Mojo::URL->new->scheme('sqlite')->path('data.db')
+ ->query(sqlite_string_mode => DBD_SQLITE_STRING_MODE_UNICODE_STRICT,
wal_mode => 1));
+
=head1 DEBUGGING
You can set the C<DBI_TRACE> environment variable to get some advanced
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-SQLite-3.006/prereqs.yml
new/Mojo-SQLite-3.007/prereqs.yml
--- old/Mojo-SQLite-3.006/prereqs.yml 2021-06-16 06:30:50.000000000 +0200
+++ new/Mojo-SQLite-3.007/prereqs.yml 2021-08-02 02:17:44.000000000 +0200
@@ -3,7 +3,7 @@
perl: '5.010001'
Carp: 0
DBI: '1.627'
- DBD::SQLite: '1.64' # for JSON1, FTS5, DQS
+ DBD::SQLite: '1.68' # for JSON1, FTS5, DQS, sqlite_string_mode
File::Spec::Functions: 0
File::Temp: 0
Mojolicious: '8.03'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-SQLite-3.006/t/00-report-prereqs.dd
new/Mojo-SQLite-3.007/t/00-report-prereqs.dd
--- old/Mojo-SQLite-3.006/t/00-report-prereqs.dd 2021-06-16
06:30:50.000000000 +0200
+++ new/Mojo-SQLite-3.007/t/00-report-prereqs.dd 2021-08-02
02:17:44.000000000 +0200
@@ -14,7 +14,7 @@
'runtime' => {
'requires' => {
'Carp' => '0',
- 'DBD::SQLite' => '1.64',
+ 'DBD::SQLite' => '1.68',
'DBI' => '1.627',
'File::Spec::Functions' => '0',
'File::Temp' => '0',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-SQLite-3.006/t/connection.t
new/Mojo-SQLite-3.007/t/connection.t
--- old/Mojo-SQLite-3.006/t/connection.t 2021-06-16 06:30:50.000000000
+0200
+++ new/Mojo-SQLite-3.007/t/connection.t 2021-08-02 02:17:44.000000000
+0200
@@ -1,6 +1,8 @@
use Mojo::Base -strict;
use Test::More;
+
+use DBD::SQLite::Constants ':dbd_sqlite_string_mode';
use Mojo::SQLite;
use URI::file;
@@ -12,7 +14,8 @@
AutoInactiveDestroy => 1,
PrintError => 0,
RaiseError => 1,
- sqlite_unicode => 1,
+ sqlite_string_mode => DBD_SQLITE_STRING_MODE_UNICODE_FALLBACK,
+ wal_mode => 1,
};
is_deeply $sql->options, $options, 'right options';
};
@@ -25,7 +28,8 @@
AutoInactiveDestroy => 1,
PrintError => 0,
RaiseError => 1,
- sqlite_unicode => 1,
+ sqlite_string_mode => DBD_SQLITE_STRING_MODE_UNICODE_FALLBACK,
+ wal_mode => 1,
};
is_deeply $sql->options, $options, 'right options';
};
@@ -38,7 +42,8 @@
AutoInactiveDestroy => 1,
PrintError => 1,
RaiseError => 1,
- sqlite_unicode => 1,
+ sqlite_string_mode => DBD_SQLITE_STRING_MODE_UNICODE_FALLBACK,
+ wal_mode => 1,
};
is_deeply $sql->options, $options, 'right options';
};
@@ -58,7 +63,8 @@
AutoInactiveDestroy => 1,
PrintError => 1,
RaiseError => 0,
- sqlite_unicode => 1,
+ sqlite_string_mode => DBD_SQLITE_STRING_MODE_UNICODE_FALLBACK,
+ wal_mode => 1,
};
is_deeply $sql->options, $options, 'right options';
};
@@ -71,7 +77,8 @@
AutoInactiveDestroy => 1,
PrintError => 0,
RaiseError => 0,
- sqlite_unicode => 1,
+ sqlite_string_mode => DBD_SQLITE_STRING_MODE_UNICODE_FALLBACK,
+ wal_mode => 1,
};
is_deeply $sql->options, $options, 'right options';
};
@@ -84,7 +91,8 @@
AutoInactiveDestroy => 1,
PrintError => 1,
RaiseError => 1,
- sqlite_unicode => 1,
+ sqlite_string_mode => DBD_SQLITE_STRING_MODE_UNICODE_FALLBACK,
+ wal_mode => 1,
};
is_deeply $sql->options, $options, 'right options';
};
@@ -94,4 +102,32 @@
like $@, qr/Invalid SQLite connection string/, 'right error';
};
+subtest 'Legacy sqlite_unicode enabled' => sub {
+ my $sql = Mojo::SQLite->new('test.db?sqlite_unicode=1');
+ like $sql->dsn, qr/^dbi:SQLite:dbname=/, 'right data source';
+ my $options = {
+ AutoCommit => 1,
+ AutoInactiveDestroy => 1,
+ PrintError => 0,
+ RaiseError => 1,
+ sqlite_unicode => 1,
+ wal_mode => 1,
+ };
+ is_deeply $sql->options, $options, 'right options';
+};
+
+subtest 'Legacy sqlite_unicode disabled' => sub {
+ my $sql = Mojo::SQLite->new('test.db?sqlite_unicode=0');
+ like $sql->dsn, qr/^dbi:SQLite:dbname=/, 'right data source';
+ my $options = {
+ AutoCommit => 1,
+ AutoInactiveDestroy => 1,
+ PrintError => 0,
+ RaiseError => 1,
+ sqlite_unicode => 0,
+ wal_mode => 1,
+ };
+ is_deeply $sql->options, $options, 'right options';
+};
+
done_testing();
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Mojo-SQLite-3.006/t/database.t
new/Mojo-SQLite-3.007/t/database.t
--- old/Mojo-SQLite-3.006/t/database.t 2021-06-16 06:30:50.000000000 +0200
+++ new/Mojo-SQLite-3.007/t/database.t 2021-08-02 02:17:44.000000000 +0200
@@ -243,6 +243,11 @@
is uc $journal_mode, 'WAL', 'right journal mode';
my $sql = Mojo::SQLite->new;
+ $sql->options->{wal_mode} = 1;
+ $journal_mode = $sql->db->query('pragma journal_mode')->arrays->first->[0];
+ is uc $journal_mode, 'WAL', 'right journal mode';
+
+ $sql = Mojo::SQLite->new;
$sql->options->{no_wal} = 1;
$journal_mode = $sql->db->query('pragma journal_mode')->arrays->first->[0];
is uc $journal_mode, 'DELETE', 'right journal mode';