sqlite3 1.6.2-arm-linux → 1.6.4-arm-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +41 -0
- data/Gemfile +8 -0
- data/INSTALLATION.md +220 -0
- data/README.md +22 -147
- data/dependencies.yml +7 -7
- data/lib/sqlite3/2.7/sqlite3_native.so +0 -0
- data/lib/sqlite3/3.0/sqlite3_native.so +0 -0
- data/lib/sqlite3/3.1/sqlite3_native.so +0 -0
- data/lib/sqlite3/3.2/sqlite3_native.so +0 -0
- data/lib/sqlite3/version.rb +2 -2
- data/test/test_database.rb +29 -5
- data/test/test_deprecated.rb +10 -5
- data/test/test_encoding.rb +10 -0
- data/test/test_integration_statement.rb +2 -2
- data/test/test_result_set.rb +18 -8
- data/test/test_statement.rb +25 -0
- data/test/test_statement_execute.rb +4 -0
- metadata +5 -82
- data/faq/faq.rb +0 -145
- data/faq/faq.yml +0 -426
- /data/{faq/faq.md → FAQ.md} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5c0cf83e380ecbdb1213b61d23163526b82c4008be7d0c328cfe93af9a15b97f
|
4
|
+
data.tar.gz: 8a993c63887de72b2ecb4e5a84bd93987cc2d7de28fb2c6da12c653de9f3da05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab7987e95969914397e7223c997bca2e90cfdd680788cd7ba483dea00032d3cf217a268daf7ee3f47e289112d1a5368fb4f671aedef388ece71b1189501280fb
|
7
|
+
data.tar.gz: b89ad5486bfe3fae00dd366ccb882753e60535e44bf3ae7b8e544b9bac8707ec3645f2db7b7dca2925193ab5762185c7749eb20be41c7a7ca42a3adc88bea76e
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,46 @@
|
|
1
1
|
# sqlite3-ruby Changelog
|
2
2
|
|
3
|
+
## 1.6.4 / 2023-08-26
|
4
|
+
|
5
|
+
### Dependencies
|
6
|
+
|
7
|
+
Vendored sqlite is updated to [v3.43.0](https://sqlite.org/releaselog/3_43_0.html).
|
8
|
+
|
9
|
+
Upstream release notes:
|
10
|
+
|
11
|
+
> SQLite Release 3.43.0 On 2023-08-24
|
12
|
+
> * Add support for Contentless-Delete FTS5 Indexes. This is a variety of FTS5 full-text search index that omits storing the content that is being indexed while also allowing records to be deleted.
|
13
|
+
> * Enhancements to the date and time functions:
|
14
|
+
> * Added new time shift modifiers of the form ±YYYY-MM-DD HH:MM:SS.SSS.
|
15
|
+
> * Added the timediff() SQL function.
|
16
|
+
> * Added the octet_length(X) SQL function.
|
17
|
+
> * Added the sqlite3_stmt_explain() API.
|
18
|
+
> * Query planner enhancements:
|
19
|
+
> * Generalize the LEFT JOIN strength reduction optimization so that it works for RIGHT and FULL JOINs as well. Rename it to OUTER JOIN strength reduction.
|
20
|
+
> * Enhance the theorem prover in the OUTER JOIN strength reduction optimization so that it returns fewer false-negatives.
|
21
|
+
> * Enhancements to the decimal extension:
|
22
|
+
> * New function decimal_pow2(N) returns the N-th power of 2 for integer N between -20000 and +20000.
|
23
|
+
> * New function decimal_exp(X) works like decimal(X) except that it returns the result in exponential notation - with a "e+NN" at the end.
|
24
|
+
> * If X is a floating-point value, then the decimal(X) function now does a full expansion of that value into its exact decimal equivalent.
|
25
|
+
> * Performance enhancements to JSON processing results in a 2x performance improvement for some kinds of processing on large JSON strings.
|
26
|
+
> * New makefile target "verify-source" checks to ensure that there are no unintentional changes in the source tree. (Works for canonical source code only - not for precompiled amalgamation tarballs.)
|
27
|
+
> * Added the SQLITE_USE_SEH compile-time option that enables Structured Exception Handling on Windows while working with the memory-mapped shm file that is part of WAL mode processing. This option is enabled by default when building on Windows using Makefile.msc.
|
28
|
+
> * The VFS for unix now assumes that the nanosleep() system call is available unless compiled with -DHAVE_NANOSLEEP=0.
|
29
|
+
|
30
|
+
|
31
|
+
## 1.6.3 / 2023-05-16
|
32
|
+
|
33
|
+
### Dependencies
|
34
|
+
|
35
|
+
Vendored sqlite is updated to [v3.42.0](https://sqlite.org/releaselog/3_42_0.html).
|
36
|
+
|
37
|
+
From the release announcement:
|
38
|
+
|
39
|
+
> This is a regular enhancement release. The main new features are:
|
40
|
+
> * SQLite will now parse and understand JSON5, though it is careful to generate only pure, canonical JSON.
|
41
|
+
> * The secure-delete option has been added to the FTS5 extension.
|
42
|
+
|
43
|
+
|
3
44
|
## 1.6.2 / 2023-03-27
|
4
45
|
|
5
46
|
### Dependencies
|
data/Gemfile
CHANGED
@@ -1,3 +1,11 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
3
|
gemspec
|
4
|
+
|
5
|
+
gem("minitest", "~> 5.15")
|
6
|
+
gem("rake-compiler", "~> 1.2.0")
|
7
|
+
gem("rake-compiler-dock", "1.3.0")
|
8
|
+
gem("rdoc", ">= 4.0", "< 7")
|
9
|
+
gem("psych", "~> 4.0") # psych 5 doesn't build on some CI platforms yet
|
10
|
+
|
11
|
+
gem("ruby_memcheck") if Gem::Platform.local.os == "linux"
|
data/INSTALLATION.md
ADDED
@@ -0,0 +1,220 @@
|
|
1
|
+
|
2
|
+
# Installation and Using SQLite3 extensions
|
3
|
+
|
4
|
+
This document will help you install the `sqlite3` ruby gem. It also contains instructions on loading database extensions and building against drop-in replacements for sqlite3.
|
5
|
+
|
6
|
+
## Installation
|
7
|
+
|
8
|
+
### Native Gems (recommended)
|
9
|
+
|
10
|
+
In v1.5.0 and later, native (precompiled) gems are available for recent Ruby versions on these platforms:
|
11
|
+
|
12
|
+
- `aarch64-linux` (requires: glibc >= 2.29)
|
13
|
+
- `arm-linux` (requires: glibc >= 2.29)
|
14
|
+
- `arm64-darwin`
|
15
|
+
- `x64-mingw32` / `x64-mingw-ucrt`
|
16
|
+
- `x86-linux` (requires: glibc >= 2.17)
|
17
|
+
- `x86_64-darwin`
|
18
|
+
- `x86_64-linux` (requires: glibc >= 2.17)
|
19
|
+
|
20
|
+
If you are using one of these Ruby versions on one of these platforms, the native gem is the recommended way to install sqlite3-ruby.
|
21
|
+
|
22
|
+
For example, on a linux system running Ruby 3.1:
|
23
|
+
|
24
|
+
``` text
|
25
|
+
$ ruby -v
|
26
|
+
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
|
27
|
+
|
28
|
+
$ time gem install sqlite3
|
29
|
+
Fetching sqlite3-1.5.0-x86_64-linux.gem
|
30
|
+
Successfully installed sqlite3-1.5.0-x86_64-linux
|
31
|
+
1 gem installed
|
32
|
+
|
33
|
+
real 0m4.274s
|
34
|
+
user 0m0.734s
|
35
|
+
sys 0m0.165s
|
36
|
+
```
|
37
|
+
|
38
|
+
#### Avoiding the precompiled native gem
|
39
|
+
|
40
|
+
The maintainers strongly urge you to use a native gem if at all possible. It will be a better experience for you and allow us to focus our efforts on improving functionality rather than diagnosing installation issues.
|
41
|
+
|
42
|
+
If you're on a platform that supports a native gem but you want to avoid using it in your project, do one of the following:
|
43
|
+
|
44
|
+
- If you're not using Bundler, then run `gem install sqlite3 --platform=ruby`
|
45
|
+
- If you are using Bundler
|
46
|
+
- version 2.3.18 or later, you can specify [`gem "sqlite3", force_ruby_platform: true`](https://bundler.io/v2.3/man/gemfile.5.html#FORCE_RUBY_PLATFORM)
|
47
|
+
- version 2.1 or later, then you'll need to run `bundle config set force_ruby_platform true`
|
48
|
+
- version 2.0 or earlier, then you'll need to run `bundle config force_ruby_platform true`
|
49
|
+
|
50
|
+
|
51
|
+
### Compiling the source gem
|
52
|
+
|
53
|
+
If you are on a platform or version of Ruby that is not covered by the Native Gems, then the vanilla "ruby platform" (non-native) gem will be installed by the `gem install` or `bundle` commands.
|
54
|
+
|
55
|
+
|
56
|
+
#### Packaged libsqlite3
|
57
|
+
|
58
|
+
By default, as of v1.5.0 of this library, the latest available version of libsqlite3 is packaged with the gem and will be compiled and used automatically. This takes a bit longer than the native gem, but will provide a modern, well-supported version of libsqlite3.
|
59
|
+
|
60
|
+
For example, on a linux system running Ruby 2.5:
|
61
|
+
|
62
|
+
``` text
|
63
|
+
$ ruby -v
|
64
|
+
ruby 2.5.9p229 (2021-04-05 revision 67939) [x86_64-linux]
|
65
|
+
|
66
|
+
$ time gem install sqlite3
|
67
|
+
Building native extensions. This could take a while...
|
68
|
+
Successfully installed sqlite3-1.5.0
|
69
|
+
1 gem installed
|
70
|
+
|
71
|
+
real 0m20.620s
|
72
|
+
user 0m23.361s
|
73
|
+
sys 0m5.839s
|
74
|
+
```
|
75
|
+
|
76
|
+
|
77
|
+
#### System libsqlite3
|
78
|
+
|
79
|
+
If you would prefer to build the sqlite3-ruby gem against your system libsqlite3, which requires that you install libsqlite3 and its development files yourself, you may do so by using the `--enable-system-libraries` flag at gem install time.
|
80
|
+
|
81
|
+
PLEASE NOTE:
|
82
|
+
|
83
|
+
- you must avoid installing a precompiled native gem (see [previous section](#avoiding-the-precompiled-native-gem))
|
84
|
+
- only versions of libsqlite3 `>= 3.5.0` are supported,
|
85
|
+
- and some library features may depend on how your libsqlite3 was compiled.
|
86
|
+
|
87
|
+
For example, on a linux system running Ruby 2.5:
|
88
|
+
|
89
|
+
``` text
|
90
|
+
$ time gem install sqlite3 -- --enable-system-libraries
|
91
|
+
Building native extensions with: '--enable-system-libraries'
|
92
|
+
This could take a while...
|
93
|
+
Successfully installed sqlite3-1.5.0
|
94
|
+
1 gem installed
|
95
|
+
|
96
|
+
real 0m4.234s
|
97
|
+
user 0m3.809s
|
98
|
+
sys 0m0.912s
|
99
|
+
```
|
100
|
+
|
101
|
+
If you're using bundler, you can opt into system libraries like this:
|
102
|
+
|
103
|
+
``` sh
|
104
|
+
bundle config build.sqlite3 --enable-system-libraries
|
105
|
+
```
|
106
|
+
|
107
|
+
If you have sqlite3 installed in a non-standard location, you may need to specify the location of the include and lib files by using `--with-sqlite-include` and `--with-sqlite-lib` options (or a `--with-sqlite-dir` option, see [MakeMakefile#dir_config](https://ruby-doc.org/stdlib-3.1.1/libdoc/mkmf/rdoc/MakeMakefile.html#method-i-dir_config)). If you have pkg-config installed and configured properly, this may not be necessary.
|
108
|
+
|
109
|
+
``` sh
|
110
|
+
gem install sqlite3 -- \
|
111
|
+
--enable-system-libraries \
|
112
|
+
--with-sqlite3-include=/opt/local/include \
|
113
|
+
--with-sqlite3-lib=/opt/local/lib
|
114
|
+
```
|
115
|
+
|
116
|
+
|
117
|
+
#### System libsqlcipher
|
118
|
+
|
119
|
+
If you'd like to link against a system-installed libsqlcipher, you may do so by using the `--with-sqlcipher` flag:
|
120
|
+
|
121
|
+
``` text
|
122
|
+
$ time gem install sqlite3 -- --with-sqlcipher
|
123
|
+
Building native extensions with: '--with-sqlcipher'
|
124
|
+
This could take a while...
|
125
|
+
Successfully installed sqlite3-1.5.0
|
126
|
+
1 gem installed
|
127
|
+
|
128
|
+
real 0m4.772s
|
129
|
+
user 0m3.906s
|
130
|
+
sys 0m0.896s
|
131
|
+
```
|
132
|
+
|
133
|
+
If you have sqlcipher installed in a non-standard location, you may need to specify the location of the include and lib files by using `--with-sqlite-include` and `--with-sqlite-lib` options (or a `--with-sqlite-dir` option, see [MakeMakefile#dir_config](https://ruby-doc.org/stdlib-3.1.1/libdoc/mkmf/rdoc/MakeMakefile.html#method-i-dir_config)). If you have pkg-config installed and configured properly, this may not be necessary.
|
134
|
+
|
135
|
+
|
136
|
+
## Using SQLite3 extensions
|
137
|
+
|
138
|
+
### How do I load a sqlite extension?
|
139
|
+
|
140
|
+
Some add-ons are available to sqlite as "extensions". The instructions that upstream sqlite provides at https://www.sqlite.org/loadext.html are the canonical source of advice, but here's a brief example showing how you can do this with the `sqlite3` ruby gem.
|
141
|
+
|
142
|
+
In this example, I'll be loading the ["spellfix" extension](https://www.sqlite.org/spellfix1.html):
|
143
|
+
|
144
|
+
``` text
|
145
|
+
# download spellfix.c from somewherehttp://www.sqlite.org/src/finfo?name=ext/misc/spellfix.c
|
146
|
+
$ wget https://raw.githubusercontent.com/sqlite/sqlite/master/ext/misc/spellfix.c
|
147
|
+
spellfix.c 100%[=================================================>] 100.89K --.-KB/s in 0.09s
|
148
|
+
|
149
|
+
# follow instructions at https://www.sqlite.org/loadext.html
|
150
|
+
# (you will need sqlite3 development packages for this)
|
151
|
+
$ gcc -g -fPIC -shared spellfix.c -o spellfix.o
|
152
|
+
|
153
|
+
$ ls -lt
|
154
|
+
total 192
|
155
|
+
-rwxrwxr-x 1 flavorjones flavorjones 87984 2023-05-24 10:44 spellfix.o
|
156
|
+
-rw-rw-r-- 1 flavorjones flavorjones 103310 2023-05-24 10:43 spellfix.c
|
157
|
+
```
|
158
|
+
|
159
|
+
Then, in your application, use that `spellfix.o` file like this:
|
160
|
+
|
161
|
+
``` ruby
|
162
|
+
require "sqlite3"
|
163
|
+
|
164
|
+
db = SQLite3::Database.new(':memory:')
|
165
|
+
db.enable_load_extension(true)
|
166
|
+
db.load_extension("/path/to/sqlite/spellfix.o")
|
167
|
+
db.execute("CREATE VIRTUAL TABLE demo USING spellfix1;")
|
168
|
+
```
|
169
|
+
|
170
|
+
### How do I use an alternative sqlite3 implementation?
|
171
|
+
|
172
|
+
Some packages, like pSQLite Encryption Extension ("SEE"), are intended to be ABI-compatible drop-in replacements for the sqlite3 shared object.
|
173
|
+
|
174
|
+
If you've installed your alternative as an autotools-style installation, the directory structure will look like this:
|
175
|
+
|
176
|
+
```
|
177
|
+
/opt/see
|
178
|
+
├── bin
|
179
|
+
│ └── sqlite3
|
180
|
+
├── include
|
181
|
+
│ ├── sqlite3.h
|
182
|
+
│ └── sqlite3ext.h
|
183
|
+
├── lib
|
184
|
+
│ ├── libsqlite3.a
|
185
|
+
│ ├── libsqlite3.la
|
186
|
+
│ ├── libsqlite3.so -> libsqlite3.so.0.8.6
|
187
|
+
│ ├── libsqlite3.so.0 -> libsqlite3.so.0.8.6
|
188
|
+
│ ├── libsqlite3.so.0.8.6
|
189
|
+
│ └── pkgconfig
|
190
|
+
│ └── sqlite3.pc
|
191
|
+
└── share
|
192
|
+
└── man
|
193
|
+
└── man1
|
194
|
+
└── sqlite3.1
|
195
|
+
```
|
196
|
+
|
197
|
+
You can build this gem against that library like this:
|
198
|
+
|
199
|
+
```
|
200
|
+
gem install sqlite3 --platform=ruby -- \
|
201
|
+
--enable-system-libraries \
|
202
|
+
--with-opt-dir=/opt/see
|
203
|
+
```
|
204
|
+
|
205
|
+
Explanation:
|
206
|
+
|
207
|
+
- use `--platform=ruby` to avoid the precompiled native gems (see the README)
|
208
|
+
- the `--` separates arguments passed to "gem install" from arguments passed to the C extension builder
|
209
|
+
- use `--enable-system-libraries` to avoid the vendored sqlite3 source
|
210
|
+
- use `--with-opt-dir=/path/to/installation` to point the build process at the desired header files and shared object files
|
211
|
+
|
212
|
+
Alternatively, if you've simply downloaded an "amalgamation" and so your compiled library and header files are in arbitrary locations, try this more detailed command:
|
213
|
+
|
214
|
+
```
|
215
|
+
gem install sqlite3 --platform=ruby -- \
|
216
|
+
--enable-system-libraries \
|
217
|
+
--with-opt-include=/path/to/include \
|
218
|
+
--with-opt-lib=/path/to/lib
|
219
|
+
```
|
220
|
+
|
data/README.md
CHANGED
@@ -1,5 +1,11 @@
|
|
1
1
|
# Ruby Interface for SQLite3
|
2
2
|
|
3
|
+
## Overview
|
4
|
+
|
5
|
+
This library allows Ruby programs to use the SQLite3 database engine (http://www.sqlite.org).
|
6
|
+
|
7
|
+
Note that this module is only compatible with SQLite 3.6.16 or newer.
|
8
|
+
|
3
9
|
* Source code: https://github.com/sparklemotion/sqlite3-ruby
|
4
10
|
* Mailing list: http://groups.google.com/group/sqlite3-ruby
|
5
11
|
* Download: http://rubygems.org/gems/sqlite3
|
@@ -9,14 +15,18 @@
|
|
9
15
|
[![Native packages](https://github.com/sparklemotion/sqlite3-ruby/actions/workflows/gem-install.yml/badge.svg)](https://github.com/sparklemotion/sqlite3-ruby/actions/workflows/gem-install.yml)
|
10
16
|
|
11
17
|
|
12
|
-
##
|
18
|
+
## Quick start
|
13
19
|
|
14
|
-
|
20
|
+
For help understanding the SQLite3 Ruby API, please read the [FAQ](./FAQ.md) and the [full API documentation](https://rubydoc.info/gems/sqlite3).
|
15
21
|
|
16
|
-
|
22
|
+
A few key classes whose APIs are often-used are:
|
23
|
+
|
24
|
+
- SQLite3::Database ([rdoc](https://rubydoc.info/gems/sqlite3/SQLite3/Database))
|
25
|
+
- SQLite3::Statement ([rdoc](https://rubydoc.info/gems/sqlite3/SQLite3/Statement))
|
26
|
+
- SQLite3::ResultSet ([rdoc](https://rubydoc.info/gems/sqlite3/SQLite3/ResultSet))
|
17
27
|
|
28
|
+
If you have any questions that you feel should be addressed in the FAQ, please send them to [the mailing list](http://groups.google.com/group/sqlite3-ruby) or open a [discussion thread](https://github.com/sparklemotion/sqlite3-ruby/discussions/categories/q-a).
|
18
29
|
|
19
|
-
## Synopsis
|
20
30
|
|
21
31
|
``` ruby
|
22
32
|
require "sqlite3"
|
@@ -67,157 +77,22 @@ end
|
|
67
77
|
# => ["Jane", "me@janedoe.com", "A", "http://blog.janedoe.com"]
|
68
78
|
```
|
69
79
|
|
70
|
-
## Installation
|
71
|
-
|
72
|
-
### Native Gems (recommended)
|
73
|
-
|
74
|
-
In v1.5.0 and later, native (precompiled) gems are available for recent Ruby versions on these platforms:
|
75
|
-
|
76
|
-
- `aarch64-linux` (requires: glibc >= 2.29)
|
77
|
-
- `arm-linux` (requires: glibc >= 2.29)
|
78
|
-
- `arm64-darwin`
|
79
|
-
- `x64-mingw32` / `x64-mingw-ucrt`
|
80
|
-
- `x86-linux` (requires: glibc >= 2.17)
|
81
|
-
- `x86_64-darwin`
|
82
|
-
- `x86_64-linux` (requires: glibc >= 2.17)
|
83
|
-
|
84
|
-
If you are using one of these Ruby versions on one of these platforms, the native gem is the recommended way to install sqlite3-ruby.
|
85
|
-
|
86
|
-
For example, on a linux system running Ruby 3.1:
|
87
|
-
|
88
|
-
``` text
|
89
|
-
$ ruby -v
|
90
|
-
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]
|
91
|
-
|
92
|
-
$ time gem install sqlite3
|
93
|
-
Fetching sqlite3-1.5.0-x86_64-linux.gem
|
94
|
-
Successfully installed sqlite3-1.5.0-x86_64-linux
|
95
|
-
1 gem installed
|
96
|
-
|
97
|
-
real 0m4.274s
|
98
|
-
user 0m0.734s
|
99
|
-
sys 0m0.165s
|
100
|
-
```
|
101
|
-
|
102
|
-
#### Avoiding the precompiled native gem
|
103
|
-
|
104
|
-
The maintainers strongly urge you to use a native gem if at all possible. It will be a better experience for you and allow us to focus our efforts on improving functionality rather than diagnosing installation issues.
|
105
|
-
|
106
|
-
If you're on a platform that supports a native gem but you want to avoid using it in your project, do one of the following:
|
107
|
-
|
108
|
-
- If you're not using Bundler, then run `gem install sqlite3 --platform=ruby`
|
109
|
-
- If you are using Bundler
|
110
|
-
- version 2.3.18 or later, you can specify [`gem "sqlite3", force_ruby_platform: true`](https://bundler.io/v2.3/man/gemfile.5.html#FORCE_RUBY_PLATFORM)
|
111
|
-
- version 2.1 or later, then you'll need to run `bundle config set force_ruby_platform true`
|
112
|
-
- version 2.0 or earlier, then you'll need to run `bundle config force_ruby_platform true`
|
113
|
-
|
114
|
-
|
115
|
-
### Compiling the source gem
|
116
|
-
|
117
|
-
If you are on a platform or version of Ruby that is not covered by the Native Gems, then the vanilla "ruby platform" (non-native) gem will be installed by the `gem install` or `bundle` commands.
|
118
|
-
|
119
|
-
|
120
|
-
#### Packaged libsqlite3
|
121
|
-
|
122
|
-
By default, as of v1.5.0 of this library, the latest available version of libsqlite3 is packaged with the gem and will be compiled and used automatically. This takes a bit longer than the native gem, but will provide a modern, well-supported version of libsqlite3.
|
123
|
-
|
124
|
-
For example, on a linux system running Ruby 2.5:
|
125
|
-
|
126
|
-
``` text
|
127
|
-
$ ruby -v
|
128
|
-
ruby 2.5.9p229 (2021-04-05 revision 67939) [x86_64-linux]
|
129
|
-
|
130
|
-
$ time gem install sqlite3
|
131
|
-
Building native extensions. This could take a while...
|
132
|
-
Successfully installed sqlite3-1.5.0
|
133
|
-
1 gem installed
|
134
|
-
|
135
|
-
real 0m20.620s
|
136
|
-
user 0m23.361s
|
137
|
-
sys 0m5.839s
|
138
|
-
```
|
139
|
-
|
140
|
-
|
141
|
-
#### System libsqlite3
|
142
|
-
|
143
|
-
If you would prefer to build the sqlite3-ruby gem against your system libsqlite3, which requires that you install libsqlite3 and its development files yourself, you may do so by using the `--enable-system-libraries` flag at gem install time.
|
144
|
-
|
145
|
-
PLEASE NOTE:
|
146
|
-
|
147
|
-
- you must avoid installing a precompiled native gem (see [previous section](#avoiding-the-precompiled-native-gem))
|
148
|
-
- only versions of libsqlite3 `>= 3.5.0` are supported,
|
149
|
-
- and some library features may depend on how your libsqlite3 was compiled.
|
150
|
-
|
151
|
-
For example, on a linux system running Ruby 2.5:
|
152
|
-
|
153
|
-
``` text
|
154
|
-
$ time gem install sqlite3 -- --enable-system-libraries
|
155
|
-
Building native extensions with: '--enable-system-libraries'
|
156
|
-
This could take a while...
|
157
|
-
Successfully installed sqlite3-1.5.0
|
158
|
-
1 gem installed
|
159
|
-
|
160
|
-
real 0m4.234s
|
161
|
-
user 0m3.809s
|
162
|
-
sys 0m0.912s
|
163
|
-
```
|
164
|
-
|
165
|
-
If you're using bundler, you can opt into system libraries like this:
|
166
|
-
|
167
|
-
``` sh
|
168
|
-
bundle config build.sqlite3 --enable-system-libraries
|
169
|
-
```
|
170
|
-
|
171
|
-
If you have sqlite3 installed in a non-standard location, you may need to specify the location of the include and lib files by using `--with-sqlite-include` and `--with-sqlite-lib` options (or a `--with-sqlite-dir` option, see [MakeMakefile#dir_config](https://ruby-doc.org/stdlib-3.1.1/libdoc/mkmf/rdoc/MakeMakefile.html#method-i-dir_config)). If you have pkg-config installed and configured properly, this may not be necessary.
|
172
|
-
|
173
|
-
``` sh
|
174
|
-
gem install sqlite3 -- \
|
175
|
-
--enable-system-libraries \
|
176
|
-
--with-sqlite3-include=/opt/local/include \
|
177
|
-
--with-sqlite3-lib=/opt/local/lib
|
178
|
-
```
|
179
|
-
|
180
|
-
|
181
|
-
#### System libsqlcipher
|
182
|
-
|
183
|
-
If you'd like to link against a system-installed libsqlcipher, you may do so by using the `--with-sqlcipher` flag:
|
184
|
-
|
185
|
-
``` text
|
186
|
-
$ time gem install sqlite3 -- --with-sqlcipher
|
187
|
-
Building native extensions with: '--with-sqlcipher'
|
188
|
-
This could take a while...
|
189
|
-
Successfully installed sqlite3-1.5.0
|
190
|
-
1 gem installed
|
191
|
-
|
192
|
-
real 0m4.772s
|
193
|
-
user 0m3.906s
|
194
|
-
sys 0m0.896s
|
195
|
-
```
|
196
|
-
|
197
|
-
If you have sqlcipher installed in a non-standard location, you may need to specify the location of the include and lib files by using `--with-sqlite-include` and `--with-sqlite-lib` options (or a `--with-sqlite-dir` option, see [MakeMakefile#dir_config](https://ruby-doc.org/stdlib-3.1.1/libdoc/mkmf/rdoc/MakeMakefile.html#method-i-dir_config)). If you have pkg-config installed and configured properly, this may not be necessary.
|
198
|
-
|
199
|
-
|
200
80
|
## Support
|
201
81
|
|
202
|
-
###
|
203
|
-
|
204
|
-
You can ask for help or support from the
|
205
|
-
[sqlite3-ruby mailing list](http://groups.google.com/group/sqlite3-ruby) which
|
206
|
-
can be found here:
|
207
|
-
|
208
|
-
> http://groups.google.com/group/sqlite3-ruby
|
209
|
-
|
82
|
+
### Installation or database extensions
|
210
83
|
|
211
|
-
|
84
|
+
If you're having trouble with installation, please first read [`INSTALLATION.md`](./INSTALLATION.md).
|
212
85
|
|
213
|
-
|
86
|
+
### General help requests
|
214
87
|
|
215
|
-
|
88
|
+
You can ask for help or support:
|
216
89
|
|
90
|
+
* by emailing the [sqlite3-ruby mailing list](http://groups.google.com/group/sqlite3-ruby)
|
91
|
+
* by opening a [discussion thread](https://github.com/sparklemotion/sqlite3-ruby/discussions/categories/q-a) on Github
|
217
92
|
|
218
|
-
|
93
|
+
### Bug reports
|
219
94
|
|
220
|
-
|
95
|
+
You can file the bug at the [github issues page](https://github.com/sparklemotion/sqlite3-ruby/issues).
|
221
96
|
|
222
97
|
|
223
98
|
## Contributing
|
data/dependencies.yml
CHANGED
@@ -2,13 +2,13 @@
|
|
2
2
|
:sqlite3:
|
3
3
|
# checksum verified by first checking the published sha3(256) checksum against https://sqlite.org/download.html:
|
4
4
|
#
|
5
|
-
# $ sha3sum -a 256 ports/archives/sqlite-autoconf-
|
6
|
-
#
|
5
|
+
# $ sha3sum -a 256 ports/archives/sqlite-autoconf-3430000.tar.gz
|
6
|
+
# cc321c7b0a70f87aaefe5d0aa89cdd97b432c3d2d448fa623f20988007c49f34 ports/archives/sqlite-autoconf-3430000.tar.gz
|
7
7
|
#
|
8
|
-
# $ sha256sum ports/archives/sqlite-autoconf-
|
9
|
-
#
|
8
|
+
# $ sha256sum ports/archives/sqlite-autoconf-3430000.tar.gz
|
9
|
+
# 49008dbf3afc04d4edc8ecfc34e4ead196973034293c997adad2f63f01762ae1 ports/archives/sqlite-autoconf-3430000.tar.gz
|
10
10
|
#
|
11
|
-
:version: "3.
|
11
|
+
:version: "3.43.0"
|
12
12
|
:files:
|
13
|
-
- :url: "https://sqlite.org/2023/sqlite-autoconf-
|
14
|
-
:sha256: "
|
13
|
+
- :url: "https://sqlite.org/2023/sqlite-autoconf-3430000.tar.gz"
|
14
|
+
:sha256: "49008dbf3afc04d4edc8ecfc34e4ead196973034293c997adad2f63f01762ae1"
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/lib/sqlite3/version.rb
CHANGED
data/test/test_database.rb
CHANGED
@@ -11,6 +11,10 @@ module SQLite3
|
|
11
11
|
super
|
12
12
|
end
|
13
13
|
|
14
|
+
def teardown
|
15
|
+
@db.close unless @db.closed?
|
16
|
+
end
|
17
|
+
|
14
18
|
def test_segv
|
15
19
|
assert_raises { SQLite3::Database.new 1 }
|
16
20
|
end
|
@@ -54,6 +58,7 @@ module SQLite3
|
|
54
58
|
assert_equal pn.realdirpath.to_s, File.realdirpath(db.filename)
|
55
59
|
ensure
|
56
60
|
tf.close! if tf
|
61
|
+
db.close if db
|
57
62
|
end
|
58
63
|
|
59
64
|
|
@@ -189,6 +194,8 @@ module SQLite3
|
|
189
194
|
def test_new
|
190
195
|
db = SQLite3::Database.new(':memory:')
|
191
196
|
assert db
|
197
|
+
ensure
|
198
|
+
db.close if db
|
192
199
|
end
|
193
200
|
|
194
201
|
def test_new_yields_self
|
@@ -210,6 +217,8 @@ module SQLite3
|
|
210
217
|
:utf16 => true)
|
211
218
|
end
|
212
219
|
assert db
|
220
|
+
ensure
|
221
|
+
db.close if db
|
213
222
|
end
|
214
223
|
|
215
224
|
def test_close
|
@@ -243,6 +252,8 @@ module SQLite3
|
|
243
252
|
db = SQLite3::Database.new(':memory:')
|
244
253
|
stmt = db.prepare('select "hello world"')
|
245
254
|
assert_instance_of(SQLite3::Statement, stmt)
|
255
|
+
ensure
|
256
|
+
stmt.close if stmt
|
246
257
|
end
|
247
258
|
|
248
259
|
def test_block_prepare_does_not_double_close
|
@@ -459,15 +470,19 @@ module SQLite3
|
|
459
470
|
end
|
460
471
|
|
461
472
|
def test_authorizer_ok
|
473
|
+
statements = []
|
474
|
+
|
462
475
|
@db.authorizer = Class.new {
|
463
476
|
def call action, a, b, c, d; true end
|
464
477
|
}.new
|
465
|
-
@db.prepare("select 'fooooo'")
|
478
|
+
statements << @db.prepare("select 'fooooo'")
|
466
479
|
|
467
480
|
@db.authorizer = Class.new {
|
468
481
|
def call action, a, b, c, d; 0 end
|
469
482
|
}.new
|
470
|
-
@db.prepare("select 'fooooo'")
|
483
|
+
statements << @db.prepare("select 'fooooo'")
|
484
|
+
ensure
|
485
|
+
statements.each(&:close)
|
471
486
|
end
|
472
487
|
|
473
488
|
def test_authorizer_ignore
|
@@ -476,6 +491,8 @@ module SQLite3
|
|
476
491
|
}.new
|
477
492
|
stmt = @db.prepare("select 'fooooo'")
|
478
493
|
assert_nil stmt.step
|
494
|
+
ensure
|
495
|
+
stmt.close if stmt
|
479
496
|
end
|
480
497
|
|
481
498
|
def test_authorizer_fail
|
@@ -496,14 +513,18 @@ module SQLite3
|
|
496
513
|
end
|
497
514
|
|
498
515
|
@db.authorizer = nil
|
499
|
-
@db.prepare("select 'fooooo'")
|
516
|
+
s = @db.prepare("select 'fooooo'")
|
517
|
+
ensure
|
518
|
+
s.close if s
|
500
519
|
end
|
501
520
|
|
502
521
|
def test_close_with_open_statements
|
503
|
-
@db.prepare("select 'foo'")
|
522
|
+
s = @db.prepare("select 'foo'")
|
504
523
|
assert_raises(SQLite3::BusyException) do
|
505
524
|
@db.close
|
506
525
|
end
|
526
|
+
ensure
|
527
|
+
s.close if s
|
507
528
|
end
|
508
529
|
|
509
530
|
def test_execute_with_empty_bind_params
|
@@ -511,7 +532,10 @@ module SQLite3
|
|
511
532
|
end
|
512
533
|
|
513
534
|
def test_query_with_named_bind_params
|
514
|
-
|
535
|
+
resultset = @db.query("select :n", {'n' => 'foo'})
|
536
|
+
assert_equal [['foo']], resultset.to_a
|
537
|
+
ensure
|
538
|
+
resultset.close if resultset
|
515
539
|
end
|
516
540
|
|
517
541
|
def test_execute_with_named_bind_params
|