extralite-bundle 2.8.2 → 2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/test-bundle.yml +1 -1
- data/.github/workflows/test.yml +4 -4
- data/CHANGELOG.md +16 -1
- data/README.md +1 -1
- data/ext/extralite/common.c +64 -22
- data/ext/extralite/database.c +9 -3
- data/ext/extralite/extralite.h +1 -1
- data/ext/extralite/query.c +2 -2
- data/ext/sqlite3/sqlite3.c +8563 -4784
- data/ext/sqlite3/sqlite3.h +343 -53
- data/gemspec.rb +6 -6
- data/lib/extralite/version.rb +1 -1
- data/test/test_database.rb +60 -1
- metadata +14 -18
data/gemspec.rb
CHANGED
@@ -15,11 +15,11 @@ def common_spec(s)
|
|
15
15
|
s.rdoc_options = ['--title', 'Extralite', '--main', 'README.md']
|
16
16
|
s.extra_rdoc_files = ['README.md']
|
17
17
|
s.require_paths = ['lib']
|
18
|
-
s.required_ruby_version = '>= 3.
|
18
|
+
s.required_ruby_version = '>= 3.2'
|
19
19
|
|
20
|
-
s.add_development_dependency 'rake-compiler', '1.2.
|
21
|
-
s.add_development_dependency 'minitest', '5.
|
22
|
-
s.add_development_dependency 'simplecov', '0.
|
23
|
-
s.add_development_dependency 'yard', '0.9.
|
24
|
-
s.add_development_dependency 'sequel', '5.
|
20
|
+
s.add_development_dependency 'rake-compiler', '1.2.9'
|
21
|
+
s.add_development_dependency 'minitest', '5.25.4'
|
22
|
+
s.add_development_dependency 'simplecov', '0.22.0'
|
23
|
+
s.add_development_dependency 'yard', '0.9.37'
|
24
|
+
s.add_development_dependency 'sequel', '5.88.0'
|
25
25
|
end
|
data/lib/extralite/version.rb
CHANGED
data/test/test_database.rb
CHANGED
@@ -40,6 +40,19 @@ class DatabaseTest < Minitest::Test
|
|
40
40
|
assert_equal [], r
|
41
41
|
end
|
42
42
|
|
43
|
+
def test_query_hash_with_many_columns
|
44
|
+
# this tests correct processing cof column names when column count is more than
|
45
|
+
# MAX_EMBEDDED_COLUMN_NAMES
|
46
|
+
r = @db.query_hash("
|
47
|
+
select 1 as a, 2 as b, 3 as c, 4 as d, 5 as e, 6 as f, 7 as g, 8 as h, 9 as i, 10 as j,
|
48
|
+
11 as k, 12 as l, 13 as m, 14 as n, 15 as o, 16 as p, 17 as q, 18 as r, 19 as s, 20 as t
|
49
|
+
")
|
50
|
+
assert_equal [{
|
51
|
+
a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8, i: 9, j: 10,
|
52
|
+
k: 11, l: 12, m: 13, n: 14, o: 15, p: 16, q: 17, r: 18, s: 19, t: 20
|
53
|
+
}], r
|
54
|
+
end
|
55
|
+
|
43
56
|
def test_query_array
|
44
57
|
r = @db.query_array('select * from t')
|
45
58
|
assert_equal [[1, 2, 3], [4, 5, 6]], r
|
@@ -363,7 +376,6 @@ class DatabaseTest < Minitest::Test
|
|
363
376
|
[1, '2', 3],
|
364
377
|
['4', 5, 6]
|
365
378
|
]
|
366
|
-
|
367
379
|
changes = @db.batch_execute('insert into foo values (?, ?, ?)', records)
|
368
380
|
|
369
381
|
assert_equal 2, changes
|
@@ -373,6 +385,23 @@ class DatabaseTest < Minitest::Test
|
|
373
385
|
], @db.query('select * from foo')
|
374
386
|
end
|
375
387
|
|
388
|
+
def test_batch_execute_with_array_of_hashes
|
389
|
+
@db.query('create table foo (a, b, c)')
|
390
|
+
assert_equal [], @db.query('select * from foo')
|
391
|
+
|
392
|
+
records = [
|
393
|
+
{ a: 1, b: '2', c: 3 },
|
394
|
+
{ a: '4', b: 5, c: 6 }
|
395
|
+
]
|
396
|
+
changes = @db.batch_execute('insert into foo values (:a, :b, :c)', records)
|
397
|
+
|
398
|
+
# assert_equal 2, changes
|
399
|
+
assert_equal [
|
400
|
+
{ a: 1, b: '2', c: 3 },
|
401
|
+
{ a: '4', b: 5, c: 6 }
|
402
|
+
], @db.query('select * from foo')
|
403
|
+
end
|
404
|
+
|
376
405
|
def test_batch_execute_single_values
|
377
406
|
@db.query('create table foo (bar)')
|
378
407
|
assert_equal [], @db.query('select * from foo')
|
@@ -1216,6 +1245,18 @@ class ScenarioTest < Minitest::Test
|
|
1216
1245
|
@db.query('select 4')
|
1217
1246
|
assert_equal ['select 1', 'select 2', 'select 3'], sqls
|
1218
1247
|
end
|
1248
|
+
|
1249
|
+
def test_database_trace_expanded_sql
|
1250
|
+
sqls = []
|
1251
|
+
@db.trace { |sql| sqls << sql }
|
1252
|
+
|
1253
|
+
@db.query('select ?, ?, ?', 1, '2', 3)
|
1254
|
+
assert_equal ["select 1, '2', 3"], sqls
|
1255
|
+
|
1256
|
+
sqls = []
|
1257
|
+
@db.query('select :x, :y, :z', x: 42, y: '43')
|
1258
|
+
assert_equal ["select 42, '43', NULL"], sqls
|
1259
|
+
end
|
1219
1260
|
end
|
1220
1261
|
|
1221
1262
|
class BackupTest < Minitest::Test
|
@@ -1359,6 +1400,12 @@ class ConcurrencyTest < Minitest::Test
|
|
1359
1400
|
def test_progress_handler_simple
|
1360
1401
|
db = Extralite::Database.new(':memory:')
|
1361
1402
|
|
1403
|
+
# SQLite's behaviour post 3.46.0 has changed, such that the first time the
|
1404
|
+
# query is ran, the progress handler is called more times than in later
|
1405
|
+
# invocations, so here we run it once before measuring, in order to have
|
1406
|
+
# reliable figures.
|
1407
|
+
result = db.query_single('select 1 as a, 2 as b, 3 as c')
|
1408
|
+
|
1362
1409
|
buf = []
|
1363
1410
|
db.on_progress(period: 1) { buf << :progress }
|
1364
1411
|
|
@@ -1377,6 +1424,12 @@ class ConcurrencyTest < Minitest::Test
|
|
1377
1424
|
def test_progress_handler_normal_mode
|
1378
1425
|
db = Extralite::Database.new(':memory:')
|
1379
1426
|
|
1427
|
+
# SQLite's behaviour post 3.46.0 has changed, such that the first time the
|
1428
|
+
# query is ran, the progress handler is called more times than in later
|
1429
|
+
# invocations, so here we run it once before measuring, in order to have
|
1430
|
+
# reliable figures.
|
1431
|
+
db.query('select 1 as a')
|
1432
|
+
|
1380
1433
|
count = 0
|
1381
1434
|
db.on_progress(period: 1) { count += 1 }
|
1382
1435
|
db.query('select 1 as a')
|
@@ -1397,6 +1450,12 @@ class ConcurrencyTest < Minitest::Test
|
|
1397
1450
|
def test_progress_handler_at_least_once_mode
|
1398
1451
|
db = Extralite::Database.new(':memory:')
|
1399
1452
|
|
1453
|
+
# SQLite's behaviour post 3.46.0 has changed, such that the first time the
|
1454
|
+
# query is ran, the progress handler is called more times than in later
|
1455
|
+
# invocations, so here we run it once before measuring, in order to have
|
1456
|
+
# reliable figures.
|
1457
|
+
db.query('select 1 as a')
|
1458
|
+
|
1400
1459
|
count = 0
|
1401
1460
|
db.on_progress(period: 1) { count += 1 }
|
1402
1461
|
db.query('select 1 as a')
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: extralite-bundle
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: '2.11'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sharon Rosner
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-03-14 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: rake-compiler
|
@@ -16,71 +15,70 @@ dependencies:
|
|
16
15
|
requirements:
|
17
16
|
- - '='
|
18
17
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.2.
|
18
|
+
version: 1.2.9
|
20
19
|
type: :development
|
21
20
|
prerelease: false
|
22
21
|
version_requirements: !ruby/object:Gem::Requirement
|
23
22
|
requirements:
|
24
23
|
- - '='
|
25
24
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.2.
|
25
|
+
version: 1.2.9
|
27
26
|
- !ruby/object:Gem::Dependency
|
28
27
|
name: minitest
|
29
28
|
requirement: !ruby/object:Gem::Requirement
|
30
29
|
requirements:
|
31
30
|
- - '='
|
32
31
|
- !ruby/object:Gem::Version
|
33
|
-
version: 5.
|
32
|
+
version: 5.25.4
|
34
33
|
type: :development
|
35
34
|
prerelease: false
|
36
35
|
version_requirements: !ruby/object:Gem::Requirement
|
37
36
|
requirements:
|
38
37
|
- - '='
|
39
38
|
- !ruby/object:Gem::Version
|
40
|
-
version: 5.
|
39
|
+
version: 5.25.4
|
41
40
|
- !ruby/object:Gem::Dependency
|
42
41
|
name: simplecov
|
43
42
|
requirement: !ruby/object:Gem::Requirement
|
44
43
|
requirements:
|
45
44
|
- - '='
|
46
45
|
- !ruby/object:Gem::Version
|
47
|
-
version: 0.
|
46
|
+
version: 0.22.0
|
48
47
|
type: :development
|
49
48
|
prerelease: false
|
50
49
|
version_requirements: !ruby/object:Gem::Requirement
|
51
50
|
requirements:
|
52
51
|
- - '='
|
53
52
|
- !ruby/object:Gem::Version
|
54
|
-
version: 0.
|
53
|
+
version: 0.22.0
|
55
54
|
- !ruby/object:Gem::Dependency
|
56
55
|
name: yard
|
57
56
|
requirement: !ruby/object:Gem::Requirement
|
58
57
|
requirements:
|
59
58
|
- - '='
|
60
59
|
- !ruby/object:Gem::Version
|
61
|
-
version: 0.9.
|
60
|
+
version: 0.9.37
|
62
61
|
type: :development
|
63
62
|
prerelease: false
|
64
63
|
version_requirements: !ruby/object:Gem::Requirement
|
65
64
|
requirements:
|
66
65
|
- - '='
|
67
66
|
- !ruby/object:Gem::Version
|
68
|
-
version: 0.9.
|
67
|
+
version: 0.9.37
|
69
68
|
- !ruby/object:Gem::Dependency
|
70
69
|
name: sequel
|
71
70
|
requirement: !ruby/object:Gem::Requirement
|
72
71
|
requirements:
|
73
72
|
- - '='
|
74
73
|
- !ruby/object:Gem::Version
|
75
|
-
version: 5.
|
74
|
+
version: 5.88.0
|
76
75
|
type: :development
|
77
76
|
prerelease: false
|
78
77
|
version_requirements: !ruby/object:Gem::Requirement
|
79
78
|
requirements:
|
80
79
|
- - '='
|
81
80
|
- !ruby/object:Gem::Version
|
82
|
-
version: 5.
|
83
|
-
description:
|
81
|
+
version: 5.88.0
|
84
82
|
email: sharon@noteflakes.com
|
85
83
|
executables: []
|
86
84
|
extensions:
|
@@ -155,7 +153,6 @@ metadata:
|
|
155
153
|
homepage_uri: https://github.com/digital-fabric/extralite
|
156
154
|
documentation_uri: https://www.rubydoc.info/gems/extralite
|
157
155
|
changelog_uri: https://github.com/digital-fabric/extralite/blob/master/CHANGELOG.md
|
158
|
-
post_install_message:
|
159
156
|
rdoc_options:
|
160
157
|
- "--title"
|
161
158
|
- Extralite
|
@@ -167,15 +164,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
167
164
|
requirements:
|
168
165
|
- - ">="
|
169
166
|
- !ruby/object:Gem::Version
|
170
|
-
version: '3.
|
167
|
+
version: '3.2'
|
171
168
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
172
169
|
requirements:
|
173
170
|
- - ">="
|
174
171
|
- !ruby/object:Gem::Version
|
175
172
|
version: '0'
|
176
173
|
requirements: []
|
177
|
-
rubygems_version: 3.
|
178
|
-
signing_key:
|
174
|
+
rubygems_version: 3.6.2
|
179
175
|
specification_version: 4
|
180
176
|
summary: Extra-lightweight SQLite3 wrapper for Ruby with bundled SQLite3
|
181
177
|
test_files: []
|