sqlite3 1.4.2 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.rdoc +17 -2
- data/Gemfile +5 -2
- data/Manifest.txt +0 -1
- data/README.rdoc +2 -2
- data/ext/sqlite3/aggregator.c +6 -6
- data/ext/sqlite3/database.c +28 -1
- data/ext/sqlite3/statement.c +2 -2
- data/faq/faq.yml +1 -1
- data/lib/sqlite3/constants.rb +1 -1
- data/lib/sqlite3/database.rb +11 -6
- data/lib/sqlite3/pragmas.rb +10 -3
- data/lib/sqlite3/statement.rb +2 -1
- data/lib/sqlite3/translator.rb +1 -1
- data/lib/sqlite3/version.rb +2 -2
- data/rakelib/gem.rake +1 -1
- data/rakelib/native.rake +5 -2
- data/rakelib/vendor_sqlite3.rake +13 -2
- data/test/helper.rb +7 -0
- data/test/test_database.rb +28 -0
- data/test/test_statement.rb +1 -1
- metadata +13 -14
- data/.travis.yml +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ca0eaf6464e1b4511b2de2dd6c49b0dd5cb9d38b02783f7c6eb6478e2e0451e2
|
4
|
+
data.tar.gz: ff8a6c67d814961cbce231dc17f4aaa9ca88337422bfe19cb0c6252448a31939
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 63219833df3802f61631a9e42678af579daa22fdaf1dcac4ab636f538567835403ae9f98db534308a72778ef71aa8bce63c7d4d9f388adbbacdef00f80aa8d1f
|
7
|
+
data.tar.gz: 8d83cb828a3cd12f9cb5e85c6d6229c6bf08c2633afb7e3e9468cfe8f3a144f5621019fb488b83f077a8a62e816aaa7bc4458cac81d2332ddd3d27feabf335ed
|
data/CHANGELOG.rdoc
CHANGED
@@ -1,4 +1,19 @@
|
|
1
|
-
=== 1.4.
|
1
|
+
=== 1.4.4 (2022-06-14)
|
2
|
+
|
3
|
+
* Fixes
|
4
|
+
* Compilation no longer fails against SQLite3 versions < 3.29.0. This issue was introduced in v1.4.3. [#324] (Thank you, @r6e!)
|
5
|
+
|
6
|
+
|
7
|
+
=== 1.4.3 (2022-05-25)
|
8
|
+
|
9
|
+
* Enhancements
|
10
|
+
* Disable non-standard support for double-quoted string literals via the `:strict` option. [#317] (Thank you, @casperisfine!)
|
11
|
+
* Column type names are now explicitly downcased on platforms where they may have been in shoutcaps. [#315] (Thank you, @petergoldstein!)
|
12
|
+
* Support File or Pathname arguments to `Database.new`. [#283] (Thank you, @yb66!)
|
13
|
+
* Support building on MSVC. [#285] (Thank you, @jmarrec!)
|
14
|
+
|
15
|
+
|
16
|
+
=== 1.4.2 (2019-12-18)
|
2
17
|
|
3
18
|
* Travis: Drop unused setting "sudo: false"
|
4
19
|
* The taint mechanism will be deprecated in Ruby 2.7
|
@@ -134,7 +149,7 @@
|
|
134
149
|
installed anymore
|
135
150
|
|
136
151
|
* Bugfixes
|
137
|
-
* Backup API is
|
152
|
+
* Backup API is conditionally required so that older libsqlite3 can be used.
|
138
153
|
Thanks Hongli Lai.
|
139
154
|
* Fixed segmentation fault when nil is passed to SQLite3::Statement.new
|
140
155
|
* Fix extconf's hardcoded path that affected installation on certain systems.
|
data/Gemfile
CHANGED
@@ -8,10 +8,13 @@ source "https://rubygems.org/"
|
|
8
8
|
gem "minitest", "~>5.11", :group => [:development, :test]
|
9
9
|
gem "rake-compiler", "~>1.0", :group => [:development, :test]
|
10
10
|
gem "rake-compiler-dock", "~>0.6.0", :group => [:development, :test]
|
11
|
-
gem "
|
11
|
+
gem "mini_portile2", "~>2.0", :group => [:development, :test]
|
12
12
|
gem "hoe-bundler", "~>1.0", :group => [:development, :test]
|
13
13
|
gem "hoe-gemspec", "~>1.0", :group => [:development, :test]
|
14
14
|
gem "rdoc", ">=4.0", "<6", :group => [:development, :test]
|
15
|
-
|
15
|
+
|
16
|
+
# hoe versions >= 3.19.0 are incompatible with Ruby 2.0 and earlier,
|
17
|
+
# but the gemspec does not indicate so...
|
18
|
+
gem "hoe", (RUBY_VERSION < "2.1" ? "3.18.1" : "~>3.20"), :group => [:development, :test]
|
16
19
|
|
17
20
|
# vim: syntax=ruby
|
data/Manifest.txt
CHANGED
data/README.rdoc
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
* http://rubygems.org/gems/sqlite3
|
6
6
|
* http://www.rubydoc.info/gems/sqlite3/frames
|
7
7
|
|
8
|
-
{<img src="https://
|
8
|
+
{<img src="https://github.com/sparklemotion/sqlite3-ruby/actions/workflows/sqlite3-ruby.yml/badge.svg" alt="Build Status" />}[https://github.com/sparklemotion/sqlite3-ruby/actions/workflows/sqlite3-ruby.yml]
|
9
9
|
|
10
10
|
== DESCRIPTION
|
11
11
|
|
@@ -66,7 +66,7 @@ Note that this module is only compatible with SQLite 3.6.16 or newer.
|
|
66
66
|
== Compilation and Installation
|
67
67
|
|
68
68
|
Install SQLite3, enabling the option SQLITE_ENABLE_COLUMN_METADATA (see
|
69
|
-
www.sqlite.org/compile.html for details).
|
69
|
+
{www.sqlite.org/compile.html}[https://www.sqlite.org/compile.html] for details).
|
70
70
|
|
71
71
|
Then do the following:
|
72
72
|
|
data/ext/sqlite3/aggregator.c
CHANGED
@@ -10,13 +10,13 @@
|
|
10
10
|
* in-flight for this aggregator. */
|
11
11
|
static VALUE cAggregatorWrapper;
|
12
12
|
|
13
|
-
/* wraps a
|
13
|
+
/* wraps a instance of the "handler" class. Loses its reference at the end of
|
14
14
|
* the xFinal callback.
|
15
15
|
*
|
16
|
-
* An AggregatorInstance holds the following
|
16
|
+
* An AggregatorInstance holds the following instance variables:
|
17
17
|
* -handler_instance: the instance to call `step` and `finalize` on.
|
18
18
|
* -exc_status: status returned by rb_protect.
|
19
|
-
* != 0 if an exception occurred. If an exception
|
19
|
+
* != 0 if an exception occurred. If an exception occurred
|
20
20
|
* `step` and `finalize` won't be called any more. */
|
21
21
|
static VALUE cAggregatorInstance;
|
22
22
|
|
@@ -48,7 +48,7 @@ rb_sqlite3_protected_funcall(VALUE self, ID method, int argc, VALUE *params,
|
|
48
48
|
}
|
49
49
|
|
50
50
|
/* called in rb_sqlite3_aggregator_step and rb_sqlite3_aggregator_final. It
|
51
|
-
* checks if the
|
51
|
+
* checks if the execution context already has an associated instance. If it
|
52
52
|
* has one, it returns it. If there is no instance yet, it creates one and
|
53
53
|
* associates it with the context. */
|
54
54
|
static VALUE
|
@@ -165,8 +165,8 @@ rb_sqlite3_aggregator_final(sqlite3_context * ctx)
|
|
165
165
|
if (exc_status) {
|
166
166
|
/* the user should never see this, as Statement.step() will pick up the
|
167
167
|
* outstanding exception and raise it instead of generating a new one
|
168
|
-
* for SQLITE_ERROR with message "Ruby Exception
|
169
|
-
sqlite3_result_error(ctx, "Ruby Exception
|
168
|
+
* for SQLITE_ERROR with message "Ruby Exception occurred" */
|
169
|
+
sqlite3_result_error(ctx, "Ruby Exception occurred", -1);
|
170
170
|
}
|
171
171
|
|
172
172
|
rb_sqlite3_aggregate_instance_destroy(ctx);
|
data/ext/sqlite3/database.c
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
#include <sqlite3_ruby.h>
|
2
2
|
#include <aggregator.h>
|
3
3
|
|
4
|
+
#if _MSC_VER
|
5
|
+
#pragma warning( push )
|
6
|
+
#pragma warning( disable : 4028 )
|
7
|
+
#endif
|
8
|
+
|
4
9
|
#define REQUIRE_OPEN_DB(_ctxt) \
|
5
10
|
if(!_ctxt->db) \
|
6
11
|
rb_raise(rb_path2class("SQLite3::Exception"), "cannot use a closed database");
|
@@ -61,6 +66,23 @@ static VALUE rb_sqlite3_open_v2(VALUE self, VALUE file, VALUE mode, VALUE zvfs)
|
|
61
66
|
return self;
|
62
67
|
}
|
63
68
|
|
69
|
+
static VALUE rb_sqlite3_disable_quirk_mode(VALUE self)
|
70
|
+
{
|
71
|
+
#if defined SQLITE_DBCONFIG_DQS_DDL
|
72
|
+
sqlite3RubyPtr ctx;
|
73
|
+
Data_Get_Struct(self, sqlite3Ruby, ctx);
|
74
|
+
|
75
|
+
if(!ctx->db) return Qfalse;
|
76
|
+
|
77
|
+
sqlite3_db_config(ctx->db, SQLITE_DBCONFIG_DQS_DDL, 0, (void*)0);
|
78
|
+
sqlite3_db_config(ctx->db, SQLITE_DBCONFIG_DQS_DML, 0, (void*)0);
|
79
|
+
|
80
|
+
return Qtrue;
|
81
|
+
#else
|
82
|
+
return Qfalse;
|
83
|
+
#endif
|
84
|
+
}
|
85
|
+
|
64
86
|
/* call-seq: db.close
|
65
87
|
*
|
66
88
|
* Closes this database.
|
@@ -705,7 +727,7 @@ static int regular_callback_function(VALUE callback_ary, int count, char **data,
|
|
705
727
|
|
706
728
|
/* Is invoked by calling db.execute_batch2(sql, &block)
|
707
729
|
*
|
708
|
-
* Executes all
|
730
|
+
* Executes all statements in a given string separated by semicolons.
|
709
731
|
* If a query is made, all values returned are strings
|
710
732
|
* (except for 'NULL' values which return nil),
|
711
733
|
* so the user may parse values with a block.
|
@@ -800,6 +822,7 @@ void init_sqlite3_database()
|
|
800
822
|
/* public "define_aggregator" is now a shim around define_aggregator2
|
801
823
|
* implemented in Ruby */
|
802
824
|
rb_define_private_method(cSqlite3Database, "define_aggregator2", rb_sqlite3_define_aggregator2, 2);
|
825
|
+
rb_define_private_method(cSqlite3Database, "disable_quirk_mode", rb_sqlite3_disable_quirk_mode, 0);
|
803
826
|
rb_define_method(cSqlite3Database, "interrupt", interrupt, 0);
|
804
827
|
rb_define_method(cSqlite3Database, "errmsg", errmsg, 0);
|
805
828
|
rb_define_method(cSqlite3Database, "errcode", errcode_, 0);
|
@@ -825,3 +848,7 @@ void init_sqlite3_database()
|
|
825
848
|
|
826
849
|
rb_sqlite3_aggregator_init();
|
827
850
|
}
|
851
|
+
|
852
|
+
#if _MSC_VER
|
853
|
+
#pragma warning( pop )
|
854
|
+
#endif
|
data/ext/sqlite3/statement.c
CHANGED
@@ -290,7 +290,7 @@ static VALUE bind_param(VALUE self, VALUE key, VALUE value)
|
|
290
290
|
/* call-seq: stmt.reset!
|
291
291
|
*
|
292
292
|
* Resets the statement. This is typically done internally, though it might
|
293
|
-
*
|
293
|
+
* occasionally be necessary to manually reset the statement.
|
294
294
|
*/
|
295
295
|
static VALUE reset_bang(VALUE self)
|
296
296
|
{
|
@@ -309,7 +309,7 @@ static VALUE reset_bang(VALUE self)
|
|
309
309
|
/* call-seq: stmt.clear_bindings!
|
310
310
|
*
|
311
311
|
* Resets the statement. This is typically done internally, though it might
|
312
|
-
*
|
312
|
+
* occasionally be necessary to manually reset the statement.
|
313
313
|
*/
|
314
314
|
static VALUE clear_bindings_bang(VALUE self)
|
315
315
|
{
|
data/faq/faq.yml
CHANGED
@@ -128,7 +128,7 @@
|
|
128
128
|
Where _n_ is an integer, and _word_ is an alpha-numeric identifier (or
|
129
129
|
number). When the placeholder is associated with a number, that number
|
130
130
|
identifies the index of the bind variable to replace it with. When it
|
131
|
-
is an identifier, it identifies the name of the
|
131
|
+
is an identifier, it identifies the name of the corresponding bind
|
132
132
|
variable. (In the instance of the first format--a single question
|
133
133
|
mark--the placeholder is assigned a number one greater than the last
|
134
134
|
index used, or 1 if it is the first.)
|
data/lib/sqlite3/constants.rb
CHANGED
@@ -37,7 +37,7 @@ module SQLite3 ; module Constants
|
|
37
37
|
EMPTY = 16 # (Internal Only) Database table is empty
|
38
38
|
SCHEMA = 17 # The database schema changed
|
39
39
|
TOOBIG = 18 # Too much data for one row of a table
|
40
|
-
CONSTRAINT = 19 # Abort due to
|
40
|
+
CONSTRAINT = 19 # Abort due to constraint violation
|
41
41
|
MISMATCH = 20 # Data type mismatch
|
42
42
|
MISUSE = 21 # Library used incorrectly
|
43
43
|
NOLFS = 22 # Uses OS features not supported on host
|
data/lib/sqlite3/database.rb
CHANGED
@@ -65,6 +65,7 @@ module SQLite3
|
|
65
65
|
def initialize file, options = {}, zvfs = nil
|
66
66
|
mode = Constants::Open::READWRITE | Constants::Open::CREATE
|
67
67
|
|
68
|
+
file = file.to_path if file.respond_to? :to_path
|
68
69
|
if file.encoding == ::Encoding::UTF_16LE || file.encoding == ::Encoding::UTF_16BE || options[:utf16]
|
69
70
|
open16 file
|
70
71
|
else
|
@@ -87,6 +88,10 @@ module SQLite3
|
|
87
88
|
end
|
88
89
|
|
89
90
|
open_v2 file.encode("utf-8"), mode, zvfs
|
91
|
+
|
92
|
+
if options[:strict]
|
93
|
+
disable_quirk_mode
|
94
|
+
end
|
90
95
|
end
|
91
96
|
|
92
97
|
@tracefunc = nil
|
@@ -237,7 +242,7 @@ Support for bind parameters as *args will be removed in 2.0.0.
|
|
237
242
|
# rows.
|
238
243
|
#
|
239
244
|
# See also #execute_batch2 for additional ways of
|
240
|
-
# executing
|
245
|
+
# executing statements.
|
241
246
|
def execute_batch( sql, bind_vars = [], *args )
|
242
247
|
# FIXME: remove this stuff later
|
243
248
|
unless [Array, Hash].include?(bind_vars.class)
|
@@ -294,7 +299,7 @@ Support for this behavior will be removed in version 2.0.0.
|
|
294
299
|
# a block can be passed to parse the values accordingly.
|
295
300
|
#
|
296
301
|
# See also #execute_batch for additional ways of
|
297
|
-
# executing
|
302
|
+
# executing statements.
|
298
303
|
def execute_batch2(sql, &block)
|
299
304
|
if block_given?
|
300
305
|
result = exec_batch(sql, @results_as_hash)
|
@@ -307,7 +312,7 @@ Support for this behavior will be removed in version 2.0.0.
|
|
307
312
|
end
|
308
313
|
|
309
314
|
# This is a convenience method for creating a statement, binding
|
310
|
-
#
|
315
|
+
# parameters to it, and calling execute:
|
311
316
|
#
|
312
317
|
# result = db.query( "select * from foo where a=?", [5])
|
313
318
|
# # is the same as
|
@@ -536,10 +541,10 @@ Support for this will be removed in version 2.0.0.
|
|
536
541
|
# db.create_aggregate_handler( LengthsAggregateHandler )
|
537
542
|
# puts db.get_first_value( "select lengths(name) from A" )
|
538
543
|
def create_aggregate_handler( handler )
|
539
|
-
# This is a
|
544
|
+
# This is a compatibility shim so the (basically pointless) FunctionProxy
|
540
545
|
# "ctx" object is passed as first argument to both step() and finalize().
|
541
546
|
# Now its up to the library user whether he prefers to store his
|
542
|
-
# temporaries as instance
|
547
|
+
# temporaries as instance variables or fields in the FunctionProxy.
|
543
548
|
# The library user still must set the result value with
|
544
549
|
# FunctionProxy.result= as there is no backwards compatible way to
|
545
550
|
# change this.
|
@@ -574,7 +579,7 @@ Support for this will be removed in version 2.0.0.
|
|
574
579
|
# The functions arity is the arity of the +step+ method.
|
575
580
|
def define_aggregator( name, aggregator )
|
576
581
|
# Previously, this has been implemented in C. Now this is just yet
|
577
|
-
# another
|
582
|
+
# another compatibility shim
|
578
583
|
proxy = Class.new do
|
579
584
|
@template = aggregator
|
580
585
|
@name = name
|
data/lib/sqlite3/pragmas.rb
CHANGED
@@ -42,11 +42,11 @@ module SQLite3
|
|
42
42
|
# Requests the given pragma (and parameters), and if the block is given,
|
43
43
|
# each row of the result set will be yielded to it. Otherwise, the results
|
44
44
|
# are returned as an array.
|
45
|
-
def get_query_pragma( name, *
|
46
|
-
if
|
45
|
+
def get_query_pragma( name, *params, &block ) # :yields: row
|
46
|
+
if params.empty?
|
47
47
|
execute( "PRAGMA #{name}", &block )
|
48
48
|
else
|
49
|
-
args = "'" +
|
49
|
+
args = "'" + params.join("','") + "'"
|
50
50
|
execute( "PRAGMA #{name}( #{args} )", &block )
|
51
51
|
end
|
52
52
|
end
|
@@ -543,6 +543,13 @@ module SQLite3
|
|
543
543
|
|
544
544
|
tweak_default(new_row) if needs_tweak_default
|
545
545
|
|
546
|
+
# Ensure the type value is downcased. On Mac and Windows
|
547
|
+
# platforms this value is now being returned as all upper
|
548
|
+
# case.
|
549
|
+
if new_row['type']
|
550
|
+
new_row['type'] = new_row['type'].downcase
|
551
|
+
end
|
552
|
+
|
546
553
|
if block_given?
|
547
554
|
yield new_row
|
548
555
|
else
|
data/lib/sqlite3/statement.rb
CHANGED
data/lib/sqlite3/translator.rb
CHANGED
@@ -43,7 +43,7 @@ Built in translators are deprecated and will be removed in version 2.0.0
|
|
43
43
|
end
|
44
44
|
|
45
45
|
# Translate the given string value to a value of the given type. In the
|
46
|
-
#
|
46
|
+
# absence of an installed translator block for the given type, the value
|
47
47
|
# itself is always returned. Further, +nil+ values are never translated,
|
48
48
|
# and are always passed straight through regardless of the type parameter.
|
49
49
|
def translate( type, value )
|
data/lib/sqlite3/version.rb
CHANGED
data/rakelib/gem.rake
CHANGED
@@ -27,7 +27,7 @@ HOE = Hoe.spec 'sqlite3' do
|
|
27
27
|
|
28
28
|
extra_dev_deps << ['rake-compiler', "~> 1.0"]
|
29
29
|
extra_dev_deps << ['rake-compiler-dock', "~> 0.6.0"]
|
30
|
-
extra_dev_deps << ["
|
30
|
+
extra_dev_deps << ["mini_portile2", "~> 2.0"]
|
31
31
|
extra_dev_deps << ["minitest", "~> 5.0"]
|
32
32
|
extra_dev_deps << ["hoe-bundler", "~> 1.0"]
|
33
33
|
extra_dev_deps << ["hoe-gemspec", "~> 1.0"]
|
data/rakelib/native.rake
CHANGED
@@ -51,6 +51,9 @@ RUBY_EXTENSION = Rake::ExtensionTask.new('sqlite3_native', HOE.spec) do |ext|
|
|
51
51
|
end
|
52
52
|
|
53
53
|
# ensure things are compiled prior testing
|
54
|
-
|
55
|
-
|
54
|
+
if RUBY_PLATFORM =~ /mingw/ then
|
55
|
+
task :test => ["compile:msys2"]
|
56
|
+
else
|
57
|
+
task :test => [:compile]
|
58
|
+
end
|
56
59
|
# vim: syntax=ruby
|
data/rakelib/vendor_sqlite3.rake
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require "rake/clean"
|
2
2
|
require "rake/extensioncompiler"
|
3
|
-
require "
|
3
|
+
require "mini_portile2"
|
4
4
|
|
5
5
|
CLOBBER.include("ports")
|
6
6
|
|
@@ -8,7 +8,7 @@ directory "ports"
|
|
8
8
|
|
9
9
|
def define_sqlite_task(platform, host)
|
10
10
|
recipe = MiniPortile.new "sqlite3", BINARY_VERSION
|
11
|
-
recipe.files
|
11
|
+
recipe.files = ["http://sqlite.org#{URL_PATH}/sqlite-autoconf-#{URL_VERSION}.tar.gz"]
|
12
12
|
recipe.host = host
|
13
13
|
|
14
14
|
desc "Compile sqlite3 for #{platform} (#{host})"
|
@@ -37,6 +37,17 @@ if RUBY_PLATFORM =~ /mingw/
|
|
37
37
|
# also prepend DevKit into compilation phase
|
38
38
|
Rake::Task["compile"].prerequisites.unshift "devkit", "ports:sqlite3:#{RUBY_PLATFORM}"
|
39
39
|
Rake::Task["native"].prerequisites.unshift "devkit", "ports:sqlite3:#{RUBY_PLATFORM}"
|
40
|
+
|
41
|
+
namespace "compile" do
|
42
|
+
desc "Build using MSYS2 sqlite package"
|
43
|
+
task :msys2 do
|
44
|
+
RUBY_EXTENSION.config_options.pop
|
45
|
+
t = Rake::Task["compile"]
|
46
|
+
t.prerequisites.clear
|
47
|
+
t.prerequisites << "devkit" << "compile:#{RUBY_PLATFORM}"
|
48
|
+
t.invoke
|
49
|
+
end
|
50
|
+
end
|
40
51
|
end
|
41
52
|
|
42
53
|
# trick to test local compilation of sqlite3
|
data/test/helper.rb
CHANGED
@@ -1,6 +1,13 @@
|
|
1
1
|
require 'sqlite3'
|
2
2
|
require 'minitest/autorun'
|
3
3
|
|
4
|
+
if ENV['GITHUB_ACTIONS'] == 'true' || ENV['CI']
|
5
|
+
$VERBOSE = nil
|
6
|
+
puts "\nSQLite3 Version: #{SQLite3::SQLITE_VERSION} $VERBOSE = nil", ""
|
7
|
+
else
|
8
|
+
puts "\nSQLite3 Version: #{SQLite3::SQLITE_VERSION}", ""
|
9
|
+
end
|
10
|
+
|
4
11
|
unless RUBY_VERSION >= "1.9"
|
5
12
|
require 'iconv'
|
6
13
|
end
|
data/test/test_database.rb
CHANGED
@@ -45,6 +45,17 @@ module SQLite3
|
|
45
45
|
tf.unlink if tf
|
46
46
|
end
|
47
47
|
|
48
|
+
|
49
|
+
def test_filename_to_path
|
50
|
+
tf = Tempfile.new 'thing'
|
51
|
+
pn = Pathname tf.path
|
52
|
+
db = SQLite3::Database.new pn
|
53
|
+
assert_equal pn.expand_path.to_s, File.expand_path(db.filename)
|
54
|
+
ensure
|
55
|
+
tf.close! if tf
|
56
|
+
end
|
57
|
+
|
58
|
+
|
48
59
|
def test_error_code
|
49
60
|
begin
|
50
61
|
db.execute 'SELECT'
|
@@ -499,5 +510,22 @@ module SQLite3
|
|
499
510
|
def test_execute_with_named_bind_params
|
500
511
|
assert_equal [['foo']], @db.execute("select :n", {'n' => 'foo'})
|
501
512
|
end
|
513
|
+
|
514
|
+
def test_strict_mode
|
515
|
+
unless Gem::Requirement.new(">= 3.29.0").satisfied_by?(Gem::Version.new(SQLite3::SQLITE_VERSION))
|
516
|
+
skip("strict mode feature not available in #{SQLite3::SQLITE_VERSION}")
|
517
|
+
end
|
518
|
+
|
519
|
+
db = SQLite3::Database.new(':memory:')
|
520
|
+
db.execute('create table numbers (val int);')
|
521
|
+
db.execute('create index index_numbers_nope ON numbers ("nope");') # nothing raised
|
522
|
+
|
523
|
+
db = SQLite3::Database.new(':memory:', :strict => true)
|
524
|
+
db.execute('create table numbers (val int);')
|
525
|
+
error = assert_raises SQLite3::SQLException do
|
526
|
+
db.execute('create index index_numbers_nope ON numbers ("nope");')
|
527
|
+
end
|
528
|
+
assert_includes error.message, "no such column: nope"
|
529
|
+
end
|
502
530
|
end
|
503
531
|
end
|
data/test/test_statement.rb
CHANGED
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sqlite3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jamis Buck
|
8
8
|
- Luis Lavena
|
9
9
|
- Aaron Patterson
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2022-06-14 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: minitest
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - "~>"
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: '5.
|
21
|
+
version: '5.15'
|
22
22
|
type: :development
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - "~>"
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: '5.
|
28
|
+
version: '5.15'
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: rake-compiler
|
31
31
|
requirement: !ruby/object:Gem::Requirement
|
@@ -55,19 +55,19 @@ dependencies:
|
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
version: 0.6.0
|
57
57
|
- !ruby/object:Gem::Dependency
|
58
|
-
name:
|
58
|
+
name: mini_portile2
|
59
59
|
requirement: !ruby/object:Gem::Requirement
|
60
60
|
requirements:
|
61
61
|
- - "~>"
|
62
62
|
- !ruby/object:Gem::Version
|
63
|
-
version: 0
|
63
|
+
version: '2.0'
|
64
64
|
type: :development
|
65
65
|
prerelease: false
|
66
66
|
version_requirements: !ruby/object:Gem::Requirement
|
67
67
|
requirements:
|
68
68
|
- - "~>"
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 0
|
70
|
+
version: '2.0'
|
71
71
|
- !ruby/object:Gem::Dependency
|
72
72
|
name: hoe-bundler
|
73
73
|
requirement: !ruby/object:Gem::Requirement
|
@@ -122,14 +122,14 @@ dependencies:
|
|
122
122
|
requirements:
|
123
123
|
- - "~>"
|
124
124
|
- !ruby/object:Gem::Version
|
125
|
-
version: '3.
|
125
|
+
version: '3.23'
|
126
126
|
type: :development
|
127
127
|
prerelease: false
|
128
128
|
version_requirements: !ruby/object:Gem::Requirement
|
129
129
|
requirements:
|
130
130
|
- - "~>"
|
131
131
|
- !ruby/object:Gem::Version
|
132
|
-
version: '3.
|
132
|
+
version: '3.23'
|
133
133
|
description: |-
|
134
134
|
This module allows Ruby programs to interface with the SQLite3
|
135
135
|
database engine (http://www.sqlite.org). You must have the
|
@@ -156,7 +156,6 @@ extra_rdoc_files:
|
|
156
156
|
- ext/sqlite3/statement.c
|
157
157
|
files:
|
158
158
|
- ".gemtest"
|
159
|
-
- ".travis.yml"
|
160
159
|
- API_CHANGES.rdoc
|
161
160
|
- CHANGELOG.rdoc
|
162
161
|
- ChangeLog.cvs
|
@@ -220,7 +219,7 @@ licenses:
|
|
220
219
|
- BSD-3-Clause
|
221
220
|
metadata:
|
222
221
|
msys2_mingw_dependencies: sqlite3
|
223
|
-
post_install_message:
|
222
|
+
post_install_message:
|
224
223
|
rdoc_options:
|
225
224
|
- "--main"
|
226
225
|
- README.rdoc
|
@@ -237,8 +236,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
237
236
|
- !ruby/object:Gem::Version
|
238
237
|
version: 1.3.5
|
239
238
|
requirements: []
|
240
|
-
rubygems_version: 3.0.
|
241
|
-
signing_key:
|
239
|
+
rubygems_version: 3.4.0.dev
|
240
|
+
signing_key:
|
242
241
|
specification_version: 4
|
243
242
|
summary: This module allows Ruby programs to interface with the SQLite3 database engine
|
244
243
|
(http://www.sqlite.org)
|
data/.travis.yml
DELETED
@@ -1,33 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
cache: bundler
|
3
|
-
before_install:
|
4
|
-
- gem update --system 2.7.7
|
5
|
-
- gem install bundler -v 1.16.2
|
6
|
-
addons:
|
7
|
-
apt:
|
8
|
-
packages:
|
9
|
-
- libgmp-dev
|
10
|
-
|
11
|
-
after_failure:
|
12
|
-
- "find . -name mkmf.log -exec cat {} \\;"
|
13
|
-
|
14
|
-
after_success:
|
15
|
-
- "find . -name mkmf.log -exec cat {} \\;"
|
16
|
-
|
17
|
-
env:
|
18
|
-
- USE_MINI_PORTILE=true
|
19
|
-
- USE_MINI_PORTILE=false
|
20
|
-
rvm:
|
21
|
-
- 1.9.3
|
22
|
-
- 2.0.0
|
23
|
-
- 2.1
|
24
|
-
- 2.2
|
25
|
-
- 2.3
|
26
|
-
- 2.4
|
27
|
-
- 2.5
|
28
|
-
- 2.6
|
29
|
-
- 2.7
|
30
|
-
- ruby-head
|
31
|
-
matrix:
|
32
|
-
allow_failures:
|
33
|
-
- env: USE_MINI_PORTILE=false
|