sqlite3 2.3.0-x86-linux-gnu → 2.4.0-x86-linux-gnu
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +15 -0
- data/CONTRIBUTING.md +11 -7
- data/dependencies.yml +8 -8
- data/ext/sqlite3/database.c +2 -8
- data/lib/sqlite3/3.1/sqlite3_native.so +0 -0
- data/lib/sqlite3/3.2/sqlite3_native.so +0 -0
- data/lib/sqlite3/3.3/sqlite3_native.so +0 -0
- data/lib/sqlite3/database.rb +110 -27
- data/lib/sqlite3/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6c94cccd8a51b9cfce38fcc370ebe8fe15d4de25073c214ba449b78fa8809c8
|
4
|
+
data.tar.gz: 5cd233018b9553f5b9d65a37a725c4226c5370b062b4cb98f7e275c5c6f8e01e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c62f455bfa8224a6b075a94097bfea56cb8116fe1fe7c67e1da1e7461749921e3d43b3de32af29fdf338b981dc4204999fd7cafd32bdecfd2907ba1590685c48
|
7
|
+
data.tar.gz: 9d760961ce53c6906005b88bd2682750954a37dd18ff7c7e680bd5f762666064da3a5fee1e35900dda42561aae463deabe463c1fc2d785d8333252ad8a1b2d04
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,20 @@
|
|
1
1
|
# sqlite3-ruby Changelog
|
2
2
|
|
3
|
+
## 2.4.0 / 2024-12-03
|
4
|
+
|
5
|
+
### Added
|
6
|
+
|
7
|
+
- `Database#load_extension` now accepts any object that responds to `#to_path`, in addition to String filesystem paths. [#586] @flavorjones
|
8
|
+
- `Database.new` now accepts an `extensions:` parameter, which is an array of SQLite extensions that will be loaded during initialization. The array may contain String filesystem paths and objects that respond to `#to_path`. [#586] @flavorjones
|
9
|
+
|
10
|
+
|
11
|
+
## 2.3.1 / 2024-11-25
|
12
|
+
|
13
|
+
### Dependencies
|
14
|
+
|
15
|
+
- Vendored sqlite is updated to [v3.47.1](https://sqlite.org/releaselog/3_47_1.html) [#589] @flavorjones
|
16
|
+
|
17
|
+
|
3
18
|
## 2.3.0 / 2024-11-20
|
4
19
|
|
5
20
|
### Added
|
data/CONTRIBUTING.md
CHANGED
@@ -45,12 +45,16 @@ Update `/dependencies.yml` to reflect:
|
|
45
45
|
|
46
46
|
## Making a release
|
47
47
|
|
48
|
-
A quick checklist:
|
48
|
+
A quick checklist to cutting a release of the sqlite3 gem:
|
49
49
|
|
50
50
|
- [ ] make sure CI is green!
|
51
|
-
-
|
52
|
-
- [ ]
|
53
|
-
- [ ] create a git tag using a format that matches the pattern `v\d+\.\d+\.\d+`, e.g. `v1.3.13`
|
54
|
-
-
|
55
|
-
- [ ] `
|
56
|
-
-
|
51
|
+
- bump the version
|
52
|
+
- [ ] update `CHANGELOG.md` and `lib/sqlite3/version.rb`
|
53
|
+
- [ ] create a git tag using a format that matches the pattern `v\d+\.\d+\.\d+`, e.g. `v1.3.13`
|
54
|
+
- build the native gems
|
55
|
+
- [ ] run `bin/build-gems` and make sure it completes and all the tests pass
|
56
|
+
- push
|
57
|
+
- [ ] `git push && git push --tags`
|
58
|
+
- [ ] `for g in gems/*.gem ; do gem push $g ; done`
|
59
|
+
- announce
|
60
|
+
- [ ] create a release at https://github.com/sparklemotion/sqlite3-ruby/releases and include sha2 checksums
|
data/dependencies.yml
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
sqlite3:
|
2
2
|
# checksum verified by first checking the published sha3(256) checksum against https://sqlite.org/download.html:
|
3
|
-
#
|
3
|
+
# c6c1756fbeb1e34e0ee31f8609bfc1fd4630b3faadde71a28ad3a55df259d854
|
4
4
|
#
|
5
|
-
# $ sha3sum -a 256 ports/archives/sqlite-autoconf-
|
6
|
-
#
|
5
|
+
# $ sha3sum -a 256 ports/archives/sqlite-autoconf-3470100.tar.gz
|
6
|
+
# c6c1756fbeb1e34e0ee31f8609bfc1fd4630b3faadde71a28ad3a55df259d854 ports/archives/sqlite-autoconf-3470100.tar.gz
|
7
7
|
#
|
8
|
-
# $ sha256sum ports/archives/sqlite-autoconf-
|
9
|
-
#
|
10
|
-
version: "3.47.
|
8
|
+
# $ sha256sum ports/archives/sqlite-autoconf-3470100.tar.gz
|
9
|
+
# 416a6f45bf2cacd494b208fdee1beda509abda951d5f47bc4f2792126f01b452 ports/archives/sqlite-autoconf-3470100.tar.gz
|
10
|
+
version: "3.47.1"
|
11
11
|
files:
|
12
|
-
- url: "https://sqlite.org/2024/sqlite-autoconf-
|
13
|
-
sha256: "
|
12
|
+
- url: "https://sqlite.org/2024/sqlite-autoconf-3470100.tar.gz"
|
13
|
+
sha256: "416a6f45bf2cacd494b208fdee1beda509abda951d5f47bc4f2792126f01b452"
|
data/ext/sqlite3/database.c
CHANGED
@@ -771,14 +771,8 @@ collation(VALUE self, VALUE name, VALUE comparator)
|
|
771
771
|
}
|
772
772
|
|
773
773
|
#ifdef HAVE_SQLITE3_LOAD_EXTENSION
|
774
|
-
/* call-seq: db.load_extension(file)
|
775
|
-
*
|
776
|
-
* Loads an SQLite extension library from the named file. Extension
|
777
|
-
* loading must be enabled using db.enable_load_extension(true) prior
|
778
|
-
* to calling this API.
|
779
|
-
*/
|
780
774
|
static VALUE
|
781
|
-
|
775
|
+
load_extension_internal(VALUE self, VALUE file)
|
782
776
|
{
|
783
777
|
sqlite3RubyPtr ctx;
|
784
778
|
int status;
|
@@ -997,7 +991,7 @@ init_sqlite3_database(void)
|
|
997
991
|
rb_define_private_method(cSqlite3Database, "db_filename", db_filename, 1);
|
998
992
|
|
999
993
|
#ifdef HAVE_SQLITE3_LOAD_EXTENSION
|
1000
|
-
|
994
|
+
rb_define_private_method(cSqlite3Database, "load_extension_internal", load_extension_internal, 1);
|
1001
995
|
#endif
|
1002
996
|
|
1003
997
|
#ifdef HAVE_SQLITE3_ENABLE_LOAD_EXTENSION
|
Binary file
|
Binary file
|
Binary file
|
data/lib/sqlite3/database.rb
CHANGED
@@ -8,8 +8,10 @@ require "sqlite3/value"
|
|
8
8
|
require "sqlite3/fork_safety"
|
9
9
|
|
10
10
|
module SQLite3
|
11
|
-
#
|
12
|
-
#
|
11
|
+
# == Overview
|
12
|
+
#
|
13
|
+
# The Database class encapsulates a single connection to a SQLite3 database. Here's a
|
14
|
+
# straightforward example of usage:
|
13
15
|
#
|
14
16
|
# require 'sqlite3'
|
15
17
|
#
|
@@ -19,28 +21,59 @@ module SQLite3
|
|
19
21
|
# end
|
20
22
|
# end
|
21
23
|
#
|
22
|
-
# It wraps the lower-level methods provided by the selected driver, and
|
23
|
-
#
|
24
|
-
# methods.
|
24
|
+
# It wraps the lower-level methods provided by the selected driver, and includes the Pragmas
|
25
|
+
# module for access to various pragma convenience methods.
|
25
26
|
#
|
26
|
-
# The Database class provides type translation services as well, by which
|
27
|
-
#
|
28
|
-
#
|
29
|
-
# for their tables). This translation only occurs when querying data from
|
27
|
+
# The Database class provides type translation services as well, by which the SQLite3 data types
|
28
|
+
# (which are all represented as strings) may be converted into their corresponding types (as
|
29
|
+
# defined in the schemas for their tables). This translation only occurs when querying data from
|
30
30
|
# the database--insertions and updates are all still typeless.
|
31
31
|
#
|
32
|
-
# Furthermore, the Database class has been designed to work well with the
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
32
|
+
# Furthermore, the Database class has been designed to work well with the ArrayFields module from
|
33
|
+
# Ara Howard. If you require the ArrayFields module before performing a query, and if you have not
|
34
|
+
# enabled results as hashes, then the results will all be indexible by field name.
|
35
|
+
#
|
36
|
+
# == Thread safety
|
37
|
+
#
|
38
|
+
# When SQLite3.threadsafe? returns true, it is safe to share instances of the database class
|
39
|
+
# among threads without adding specific locking. Other object instances may require applications
|
40
|
+
# to provide their own locks if they are to be shared among threads. Please see the README.md for
|
41
|
+
# more information.
|
42
|
+
#
|
43
|
+
# == SQLite Extensions
|
44
|
+
#
|
45
|
+
# SQLite3::Database supports the universe of {sqlite
|
46
|
+
# extensions}[https://www.sqlite.org/loadext.html]. It's possible to load an extension into an
|
47
|
+
# existing Database object using the #load_extension method and passing a filesystem path:
|
48
|
+
#
|
49
|
+
# db = SQLite3::Database.new(":memory:")
|
50
|
+
# db.enable_load_extension(true)
|
51
|
+
# db.load_extension("/path/to/extension")
|
52
|
+
#
|
53
|
+
# As of v2.4.0, it's also possible to pass an object that responds to +#to_path+. This
|
54
|
+
# documentation will refer to the supported interface as +_ExtensionSpecifier+, which can be
|
55
|
+
# expressed in RBS syntax as:
|
56
|
+
#
|
57
|
+
# interface _ExtensionSpecifier
|
58
|
+
# def to_path: () → String
|
59
|
+
# end
|
36
60
|
#
|
37
|
-
#
|
61
|
+
# So, for example, if you are using the {sqlean gem}[https://github.com/flavorjones/sqlean-ruby]
|
62
|
+
# which provides modules that implement this interface, you can pass the module directly:
|
63
|
+
#
|
64
|
+
# db = SQLite3::Database.new(":memory:")
|
65
|
+
# db.enable_load_extension(true)
|
66
|
+
# db.load_extension(SQLean::Crypto)
|
67
|
+
#
|
68
|
+
# It's also possible in v2.4.0+ to load extensions via the SQLite3::Database constructor by using
|
69
|
+
# the +extensions:+ keyword argument to pass an array of String paths or extension specifiers:
|
70
|
+
#
|
71
|
+
# db = SQLite3::Database.new(":memory:", extensions: ["/path/to/extension", SQLean::Crypto])
|
72
|
+
#
|
73
|
+
# Note that when loading extensions via the constructor, there is no need to call
|
74
|
+
# #enable_load_extension; however it is still necessary to call #enable_load_extensions before any
|
75
|
+
# subsequently invocations of #load_extension on the initialized Database object.
|
38
76
|
#
|
39
|
-
# When `SQLite3.threadsafe?` returns true, it is safe to share instances of
|
40
|
-
# the database class among threads without adding specific locking. Other
|
41
|
-
# object instances may require applications to provide their own locks if
|
42
|
-
# they are to be shared among threads. Please see the README.md for more
|
43
|
-
# information.
|
44
77
|
class Database
|
45
78
|
attr_reader :collations
|
46
79
|
|
@@ -76,23 +109,25 @@ module SQLite3
|
|
76
109
|
# as hashes or not. By default, rows are returned as arrays.
|
77
110
|
attr_accessor :results_as_hash
|
78
111
|
|
79
|
-
# call-seq:
|
112
|
+
# call-seq:
|
113
|
+
# SQLite3::Database.new(file, options = {})
|
80
114
|
#
|
81
115
|
# Create a new Database object that opens the given file.
|
82
116
|
#
|
83
117
|
# Supported permissions +options+:
|
84
118
|
# - the default mode is <tt>READWRITE | CREATE</tt>
|
85
|
-
# -
|
86
|
-
# -
|
87
|
-
# -
|
119
|
+
# - +readonly:+ boolean (default false), true to set the mode to +READONLY+
|
120
|
+
# - +readwrite:+ boolean (default false), true to set the mode to +READWRITE+
|
121
|
+
# - +flags:+ set the mode to a combination of SQLite3::Constants::Open flags.
|
88
122
|
#
|
89
123
|
# Supported encoding +options+:
|
90
|
-
# -
|
124
|
+
# - +utf16:+ +boolish+ (default false), is the filename's encoding UTF-16 (only needed if the filename encoding is not UTF_16LE or BE)
|
91
125
|
#
|
92
126
|
# Other supported +options+:
|
93
|
-
# -
|
94
|
-
# -
|
95
|
-
# -
|
127
|
+
# - +strict:+ +boolish+ (default false), disallow the use of double-quoted string literals (see https://www.sqlite.org/quirks.html#double_quoted_string_literals_are_accepted)
|
128
|
+
# - +results_as_hash:+ +boolish+ (default false), return rows as hashes instead of arrays
|
129
|
+
# - +default_transaction_mode:+ one of +:deferred+ (default), +:immediate+, or +:exclusive+. If a mode is not specified in a call to #transaction, this will be the default transaction mode.
|
130
|
+
# - +extensions:+ <tt>Array[String | _ExtensionSpecifier]</tt> SQLite extensions to load into the database. See Database@SQLite+Extensions for more information.
|
96
131
|
#
|
97
132
|
def initialize file, options = {}, zvfs = nil
|
98
133
|
mode = Constants::Open::READWRITE | Constants::Open::CREATE
|
@@ -135,6 +170,8 @@ module SQLite3
|
|
135
170
|
@readonly = mode & Constants::Open::READONLY != 0
|
136
171
|
@default_transaction_mode = options[:default_transaction_mode] || :deferred
|
137
172
|
|
173
|
+
initialize_extensions(options[:extensions])
|
174
|
+
|
138
175
|
ForkSafety.track(self)
|
139
176
|
|
140
177
|
if block_given?
|
@@ -658,6 +695,52 @@ module SQLite3
|
|
658
695
|
end
|
659
696
|
end
|
660
697
|
|
698
|
+
# call-seq:
|
699
|
+
# load_extension(extension_specifier) -> self
|
700
|
+
#
|
701
|
+
# Loads an SQLite extension library from the named file. Extension loading must be enabled using
|
702
|
+
# #enable_load_extension prior to using this method.
|
703
|
+
#
|
704
|
+
# See also: Database@SQLite+Extensions
|
705
|
+
#
|
706
|
+
# [Parameters]
|
707
|
+
# - +extension_specifier+: (String | +_ExtensionSpecifier+) If a String, it is the filesystem path
|
708
|
+
# to the sqlite extension file. If an object that responds to #to_path, the
|
709
|
+
# return value of that method is used as the filesystem path to the sqlite extension file.
|
710
|
+
#
|
711
|
+
# [Example] Using a filesystem path:
|
712
|
+
#
|
713
|
+
# db.load_extension("/path/to/my_extension.so")
|
714
|
+
#
|
715
|
+
# [Example] Using the {sqlean gem}[https://github.com/flavorjones/sqlean-ruby]:
|
716
|
+
#
|
717
|
+
# db.load_extension(SQLean::VSV)
|
718
|
+
#
|
719
|
+
def load_extension(extension_specifier)
|
720
|
+
if extension_specifier.respond_to?(:to_path)
|
721
|
+
extension_specifier = extension_specifier.to_path
|
722
|
+
elsif !extension_specifier.is_a?(String)
|
723
|
+
raise TypeError, "extension_specifier #{extension_specifier.inspect} is not a String or a valid extension specifier object"
|
724
|
+
end
|
725
|
+
load_extension_internal(extension_specifier)
|
726
|
+
end
|
727
|
+
|
728
|
+
def initialize_extensions(extensions) # :nodoc:
|
729
|
+
return if extensions.nil?
|
730
|
+
raise TypeError, "extensions must be an Array" unless extensions.is_a?(Array)
|
731
|
+
return if extensions.empty?
|
732
|
+
|
733
|
+
begin
|
734
|
+
enable_load_extension(true)
|
735
|
+
|
736
|
+
extensions.each do |extension|
|
737
|
+
load_extension(extension)
|
738
|
+
end
|
739
|
+
ensure
|
740
|
+
enable_load_extension(false)
|
741
|
+
end
|
742
|
+
end
|
743
|
+
|
661
744
|
# A helper class for dealing with custom functions (see #create_function,
|
662
745
|
# #create_aggregate, and #create_aggregate_handler). It encapsulates the
|
663
746
|
# opaque function object that represents the current invocation. It also
|
data/lib/sqlite3/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sqlite3
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0
|
5
5
|
platform: x86-linux-gnu
|
6
6
|
authors:
|
7
7
|
- Jamis Buck
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2024-
|
14
|
+
date: 2024-12-03 00:00:00.000000000 Z
|
15
15
|
dependencies: []
|
16
16
|
description: |
|
17
17
|
Ruby library to interface with the SQLite3 database engine (http://www.sqlite.org). Precompiled
|