sqlite3 1.3.11-x64-mingw32 → 1.5.0.rc1-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gemtest +0 -0
- data/{API_CHANGES.rdoc → API_CHANGES.md} +3 -4
- data/CHANGELOG.md +419 -0
- data/CONTRIBUTING.md +24 -0
- data/Gemfile +2 -15
- data/LICENSE-DEPENDENCIES +20 -0
- data/README.md +233 -0
- data/ext/sqlite3/aggregator.c +273 -0
- data/ext/sqlite3/aggregator.h +12 -0
- data/ext/sqlite3/database.c +210 -182
- data/ext/sqlite3/database.h +2 -0
- data/ext/sqlite3/exception.c +6 -2
- data/ext/sqlite3/extconf.rb +148 -39
- data/ext/sqlite3/sqlite3.c +67 -1
- data/ext/sqlite3/sqlite3_ruby.h +0 -7
- data/ext/sqlite3/statement.c +15 -20
- data/faq/faq.md +431 -0
- data/faq/faq.yml +1 -1
- data/lib/sqlite3/2.6/sqlite3_native.so +0 -0
- data/lib/sqlite3/2.7/sqlite3_native.so +0 -0
- data/lib/sqlite3/3.0/sqlite3_native.so +0 -0
- data/lib/sqlite3/constants.rb +2 -1
- data/lib/sqlite3/database.rb +209 -58
- data/lib/sqlite3/errors.rb +1 -10
- data/lib/sqlite3/pragmas.rb +372 -57
- data/lib/sqlite3/resultset.rb +2 -10
- data/lib/sqlite3/statement.rb +2 -1
- data/lib/sqlite3/translator.rb +1 -1
- data/lib/sqlite3/version.rb +4 -4
- data/lib/sqlite3.rb +5 -0
- data/test/helper.rb +9 -0
- data/test/test_database.rb +180 -9
- data/test/test_database_flags.rb +95 -0
- data/test/test_database_readonly.rb +9 -2
- data/test/test_database_readwrite.rb +41 -0
- data/test/test_integration.rb +12 -77
- data/test/test_integration_aggregate.rb +336 -0
- data/test/test_integration_resultset.rb +0 -17
- data/test/test_sqlite3.rb +16 -0
- data/test/test_statement.rb +12 -9
- metadata +55 -84
- data/CHANGELOG.rdoc +0 -287
- data/Manifest.txt +0 -52
- data/README.rdoc +0 -101
- data/Rakefile +0 -10
- data/lib/sqlite3/2.0/sqlite3_native.so +0 -0
- data/lib/sqlite3/2.1/sqlite3_native.so +0 -0
- data/lib/sqlite3/2.2/sqlite3_native.so +0 -0
- data/setup.rb +0 -1333
- data/tasks/faq.rake +0 -9
- data/tasks/gem.rake +0 -38
- data/tasks/native.rake +0 -52
- data/tasks/vendor_sqlite3.rake +0 -97
data/lib/sqlite3/pragmas.rb
CHANGED
@@ -13,52 +13,48 @@ module SQLite3
|
|
13
13
|
def get_boolean_pragma( name )
|
14
14
|
get_first_value( "PRAGMA #{name}" ) != "0"
|
15
15
|
end
|
16
|
-
private :get_boolean_pragma
|
17
16
|
|
18
17
|
# Sets the given pragma to the given boolean value. The value itself
|
19
18
|
# may be +true+ or +false+, or any other commonly used string or
|
20
19
|
# integer that represents truth.
|
21
20
|
def set_boolean_pragma( name, mode )
|
22
21
|
case mode
|
23
|
-
|
22
|
+
when String
|
24
23
|
case mode.downcase
|
25
|
-
|
26
|
-
|
27
|
-
|
24
|
+
when "on", "yes", "true", "y", "t"; mode = "'ON'"
|
25
|
+
when "off", "no", "false", "n", "f"; mode = "'OFF'"
|
26
|
+
else
|
28
27
|
raise Exception,
|
29
28
|
"unrecognized pragma parameter #{mode.inspect}"
|
30
29
|
end
|
31
|
-
|
30
|
+
when true, 1
|
32
31
|
mode = "ON"
|
33
|
-
|
32
|
+
when false, 0, nil
|
34
33
|
mode = "OFF"
|
35
|
-
|
34
|
+
else
|
36
35
|
raise Exception,
|
37
36
|
"unrecognized pragma parameter #{mode.inspect}"
|
38
37
|
end
|
39
38
|
|
40
39
|
execute( "PRAGMA #{name}=#{mode}" )
|
41
40
|
end
|
42
|
-
private :set_boolean_pragma
|
43
41
|
|
44
42
|
# Requests the given pragma (and parameters), and if the block is given,
|
45
43
|
# each row of the result set will be yielded to it. Otherwise, the results
|
46
44
|
# are returned as an array.
|
47
|
-
def get_query_pragma( name, *
|
48
|
-
if
|
45
|
+
def get_query_pragma( name, *params, &block ) # :yields: row
|
46
|
+
if params.empty?
|
49
47
|
execute( "PRAGMA #{name}", &block )
|
50
48
|
else
|
51
|
-
args = "'" +
|
49
|
+
args = "'" + params.join("','") + "'"
|
52
50
|
execute( "PRAGMA #{name}( #{args} )", &block )
|
53
51
|
end
|
54
52
|
end
|
55
|
-
private :get_query_pragma
|
56
53
|
|
57
54
|
# Return the value of the given pragma.
|
58
55
|
def get_enum_pragma( name )
|
59
56
|
get_first_value( "PRAGMA #{name}" )
|
60
57
|
end
|
61
|
-
private :get_enum_pragma
|
62
58
|
|
63
59
|
# Set the value of the given pragma to +mode+. The +mode+ parameter must
|
64
60
|
# conform to one of the values in the given +enum+ array. Each entry in
|
@@ -71,20 +67,17 @@ module SQLite3
|
|
71
67
|
"unrecognized #{name} #{mode.inspect}" unless match
|
72
68
|
execute( "PRAGMA #{name}='#{match.first.upcase}'" )
|
73
69
|
end
|
74
|
-
private :set_enum_pragma
|
75
70
|
|
76
71
|
# Returns the value of the given pragma as an integer.
|
77
72
|
def get_int_pragma( name )
|
78
73
|
get_first_value( "PRAGMA #{name}" ).to_i
|
79
74
|
end
|
80
|
-
private :get_int_pragma
|
81
75
|
|
82
76
|
# Set the value of the given pragma to the integer value of the +value+
|
83
77
|
# parameter.
|
84
78
|
def set_int_pragma( name, value )
|
85
79
|
execute( "PRAGMA #{name}=#{value.to_i}" )
|
86
80
|
end
|
87
|
-
private :set_int_pragma
|
88
81
|
|
89
82
|
# The enumeration of valid synchronous modes.
|
90
83
|
SYNCHRONOUS_MODES = [ [ 'full', 2 ], [ 'normal', 1 ], [ 'off', 0 ] ]
|
@@ -92,37 +85,52 @@ module SQLite3
|
|
92
85
|
# The enumeration of valid temp store modes.
|
93
86
|
TEMP_STORE_MODES = [ [ 'default', 0 ], [ 'file', 1 ], [ 'memory', 2 ] ]
|
94
87
|
|
95
|
-
#
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
88
|
+
# The enumeration of valid auto vacuum modes.
|
89
|
+
AUTO_VACUUM_MODES = [ [ 'none', 0 ], [ 'full', 1 ], [ 'incremental', 2 ] ]
|
90
|
+
|
91
|
+
# The list of valid journaling modes.
|
92
|
+
JOURNAL_MODES = [ [ 'delete' ], [ 'truncate' ], [ 'persist' ], [ 'memory' ],
|
93
|
+
[ 'wal' ], [ 'off' ] ]
|
94
|
+
|
95
|
+
# The list of valid locking modes.
|
96
|
+
LOCKING_MODES = [ [ 'normal' ], [ 'exclusive' ] ]
|
97
|
+
|
98
|
+
# The list of valid encodings.
|
99
|
+
ENCODINGS = [ [ 'utf-8' ], [ 'utf-16' ], [ 'utf-16le' ], [ 'utf-16be ' ] ]
|
100
|
+
|
101
|
+
# The list of valid WAL checkpoints.
|
102
|
+
WAL_CHECKPOINTS = [ [ 'passive' ], [ 'full' ], [ 'restart' ], [ 'truncate' ] ]
|
103
|
+
|
104
|
+
def application_id
|
105
|
+
get_int_pragma "application_id"
|
106
|
+
end
|
107
|
+
|
108
|
+
def application_id=( integer )
|
109
|
+
set_int_pragma "application_id", integer
|
102
110
|
end
|
103
111
|
|
104
112
|
def auto_vacuum
|
105
|
-
|
113
|
+
get_enum_pragma "auto_vacuum"
|
106
114
|
end
|
107
115
|
|
108
116
|
def auto_vacuum=( mode )
|
109
|
-
|
117
|
+
set_enum_pragma "auto_vacuum", mode, AUTO_VACUUM_MODES
|
110
118
|
end
|
111
119
|
|
112
|
-
def
|
113
|
-
|
120
|
+
def automatic_index
|
121
|
+
get_boolean_pragma "automatic_index"
|
114
122
|
end
|
115
123
|
|
116
|
-
def
|
117
|
-
|
124
|
+
def automatic_index=( mode )
|
125
|
+
set_boolean_pragma "automatic_index", mode
|
118
126
|
end
|
119
127
|
|
120
|
-
def
|
121
|
-
get_int_pragma "
|
128
|
+
def busy_timeout
|
129
|
+
get_int_pragma "busy_timeout"
|
122
130
|
end
|
123
131
|
|
124
|
-
def
|
125
|
-
set_int_pragma "
|
132
|
+
def busy_timeout=( milliseconds )
|
133
|
+
set_int_pragma "busy_timeout", milliseconds
|
126
134
|
end
|
127
135
|
|
128
136
|
def cache_size
|
@@ -133,6 +141,58 @@ module SQLite3
|
|
133
141
|
set_int_pragma "cache_size", size
|
134
142
|
end
|
135
143
|
|
144
|
+
def cache_spill
|
145
|
+
get_boolean_pragma "cache_spill"
|
146
|
+
end
|
147
|
+
|
148
|
+
def cache_spill=( mode )
|
149
|
+
set_boolean_pragma "cache_spill", mode
|
150
|
+
end
|
151
|
+
|
152
|
+
def case_sensitive_like=( mode )
|
153
|
+
set_boolean_pragma "case_sensitive_like", mode
|
154
|
+
end
|
155
|
+
|
156
|
+
def cell_size_check
|
157
|
+
get_boolean_pragma "cell_size_check"
|
158
|
+
end
|
159
|
+
|
160
|
+
def cell_size_check=( mode )
|
161
|
+
set_boolean_pragma "cell_size_check", mode
|
162
|
+
end
|
163
|
+
|
164
|
+
def checkpoint_fullfsync
|
165
|
+
get_boolean_pragma "checkpoint_fullfsync"
|
166
|
+
end
|
167
|
+
|
168
|
+
def checkpoint_fullfsync=( mode )
|
169
|
+
set_boolean_pragma "checkpoint_fullfsync", mode
|
170
|
+
end
|
171
|
+
|
172
|
+
def collation_list( &block ) # :yields: row
|
173
|
+
get_query_pragma "collation_list", &block
|
174
|
+
end
|
175
|
+
|
176
|
+
def compile_options( &block ) # :yields: row
|
177
|
+
get_query_pragma "compile_options", &block
|
178
|
+
end
|
179
|
+
|
180
|
+
def count_changes
|
181
|
+
get_boolean_pragma "count_changes"
|
182
|
+
end
|
183
|
+
|
184
|
+
def count_changes=( mode )
|
185
|
+
set_boolean_pragma "count_changes", mode
|
186
|
+
end
|
187
|
+
|
188
|
+
def data_version
|
189
|
+
get_int_pragma "data_version"
|
190
|
+
end
|
191
|
+
|
192
|
+
def database_list( &block ) # :yields: row
|
193
|
+
get_query_pragma "database_list", &block
|
194
|
+
end
|
195
|
+
|
136
196
|
def default_cache_size
|
137
197
|
get_int_pragma "default_cache_size"
|
138
198
|
end
|
@@ -149,14 +209,6 @@ module SQLite3
|
|
149
209
|
set_enum_pragma "default_synchronous", mode, SYNCHRONOUS_MODES
|
150
210
|
end
|
151
211
|
|
152
|
-
def synchronous
|
153
|
-
get_enum_pragma "synchronous"
|
154
|
-
end
|
155
|
-
|
156
|
-
def synchronous=( mode )
|
157
|
-
set_enum_pragma "synchronous", mode, SYNCHRONOUS_MODES
|
158
|
-
end
|
159
|
-
|
160
212
|
def default_temp_store
|
161
213
|
get_enum_pragma "default_temp_store"
|
162
214
|
end
|
@@ -164,13 +216,41 @@ module SQLite3
|
|
164
216
|
def default_temp_store=( mode )
|
165
217
|
set_enum_pragma "default_temp_store", mode, TEMP_STORE_MODES
|
166
218
|
end
|
167
|
-
|
168
|
-
def
|
169
|
-
|
219
|
+
|
220
|
+
def defer_foreign_keys
|
221
|
+
get_boolean_pragma "defer_foreign_keys"
|
170
222
|
end
|
171
223
|
|
172
|
-
def
|
173
|
-
|
224
|
+
def defer_foreign_keys=( mode )
|
225
|
+
set_boolean_pragma "defer_foreign_keys", mode
|
226
|
+
end
|
227
|
+
|
228
|
+
def encoding
|
229
|
+
get_enum_pragma "encoding"
|
230
|
+
end
|
231
|
+
|
232
|
+
def encoding=( mode )
|
233
|
+
set_enum_pragma "encoding", mode, ENCODINGS
|
234
|
+
end
|
235
|
+
|
236
|
+
def foreign_key_check( *table, &block ) # :yields: row
|
237
|
+
get_query_pragma "foreign_key_check", *table, &block
|
238
|
+
end
|
239
|
+
|
240
|
+
def foreign_key_list( table, &block ) # :yields: row
|
241
|
+
get_query_pragma "foreign_key_list", table, &block
|
242
|
+
end
|
243
|
+
|
244
|
+
def foreign_keys
|
245
|
+
get_boolean_pragma "foreign_keys"
|
246
|
+
end
|
247
|
+
|
248
|
+
def foreign_keys=( mode )
|
249
|
+
set_boolean_pragma "foreign_keys", mode
|
250
|
+
end
|
251
|
+
|
252
|
+
def freelist_count
|
253
|
+
get_int_pragma "freelist_count"
|
174
254
|
end
|
175
255
|
|
176
256
|
def full_column_names
|
@@ -181,14 +261,238 @@ module SQLite3
|
|
181
261
|
set_boolean_pragma "full_column_names", mode
|
182
262
|
end
|
183
263
|
|
184
|
-
def
|
185
|
-
get_boolean_pragma "
|
264
|
+
def fullfsync
|
265
|
+
get_boolean_pragma "fullfsync"
|
266
|
+
end
|
267
|
+
|
268
|
+
def fullfsync=( mode )
|
269
|
+
set_boolean_pragma "fullfsync", mode
|
270
|
+
end
|
271
|
+
|
272
|
+
def ignore_check_constraints=( mode )
|
273
|
+
set_boolean_pragma "ignore_check_constraints", mode
|
274
|
+
end
|
275
|
+
|
276
|
+
def incremental_vacuum( pages, &block ) # :yields: row
|
277
|
+
get_query_pragma "incremental_vacuum", pages, &block
|
278
|
+
end
|
279
|
+
|
280
|
+
def index_info( index, &block ) # :yields: row
|
281
|
+
get_query_pragma "index_info", index, &block
|
282
|
+
end
|
283
|
+
|
284
|
+
def index_list( table, &block ) # :yields: row
|
285
|
+
get_query_pragma "index_list", table, &block
|
286
|
+
end
|
287
|
+
|
288
|
+
def index_xinfo( index, &block ) # :yields: row
|
289
|
+
get_query_pragma "index_xinfo", index, &block
|
290
|
+
end
|
291
|
+
|
292
|
+
def integrity_check( *num_errors, &block ) # :yields: row
|
293
|
+
get_query_pragma "integrity_check", *num_errors, &block
|
294
|
+
end
|
295
|
+
|
296
|
+
def journal_mode
|
297
|
+
get_enum_pragma "journal_mode"
|
298
|
+
end
|
299
|
+
|
300
|
+
def journal_mode=( mode )
|
301
|
+
set_enum_pragma "journal_mode", mode, JOURNAL_MODES
|
302
|
+
end
|
303
|
+
|
304
|
+
def journal_size_limit
|
305
|
+
get_int_pragma "journal_size_limit"
|
306
|
+
end
|
307
|
+
|
308
|
+
def journal_size_limit=( size )
|
309
|
+
set_int_pragma "journal_size_limit", size
|
310
|
+
end
|
311
|
+
|
312
|
+
def legacy_file_format
|
313
|
+
get_boolean_pragma "legacy_file_format"
|
314
|
+
end
|
315
|
+
|
316
|
+
def legacy_file_format=( mode )
|
317
|
+
set_boolean_pragma "legacy_file_format", mode
|
318
|
+
end
|
319
|
+
|
320
|
+
def locking_mode
|
321
|
+
get_enum_pragma "locking_mode"
|
322
|
+
end
|
323
|
+
|
324
|
+
def locking_mode=( mode )
|
325
|
+
set_enum_pragma "locking_mode", mode, LOCKING_MODES
|
326
|
+
end
|
327
|
+
|
328
|
+
def max_page_count
|
329
|
+
get_int_pragma "max_page_count"
|
330
|
+
end
|
331
|
+
|
332
|
+
def max_page_count=( size )
|
333
|
+
set_int_pragma "max_page_count", size
|
334
|
+
end
|
335
|
+
|
336
|
+
def mmap_size
|
337
|
+
get_int_pragma "mmap_size"
|
338
|
+
end
|
339
|
+
|
340
|
+
def mmap_size=( size )
|
341
|
+
set_int_pragma "mmap_size", size
|
342
|
+
end
|
343
|
+
|
344
|
+
def page_count
|
345
|
+
get_int_pragma "page_count"
|
346
|
+
end
|
347
|
+
|
348
|
+
def page_size
|
349
|
+
get_int_pragma "page_size"
|
350
|
+
end
|
351
|
+
|
352
|
+
def page_size=( size )
|
353
|
+
set_int_pragma "page_size", size
|
186
354
|
end
|
187
355
|
|
188
356
|
def parser_trace=( mode )
|
189
357
|
set_boolean_pragma "parser_trace", mode
|
190
358
|
end
|
191
359
|
|
360
|
+
def query_only
|
361
|
+
get_boolean_pragma "query_only"
|
362
|
+
end
|
363
|
+
|
364
|
+
def query_only=( mode )
|
365
|
+
set_boolean_pragma "query_only", mode
|
366
|
+
end
|
367
|
+
|
368
|
+
def quick_check( *num_errors, &block ) # :yields: row
|
369
|
+
get_query_pragma "quick_check", *num_errors, &block
|
370
|
+
end
|
371
|
+
|
372
|
+
def read_uncommitted
|
373
|
+
get_boolean_pragma "read_uncommitted"
|
374
|
+
end
|
375
|
+
|
376
|
+
def read_uncommitted=( mode )
|
377
|
+
set_boolean_pragma "read_uncommitted", mode
|
378
|
+
end
|
379
|
+
|
380
|
+
def recursive_triggers
|
381
|
+
get_boolean_pragma "recursive_triggers"
|
382
|
+
end
|
383
|
+
|
384
|
+
def recursive_triggers=( mode )
|
385
|
+
set_boolean_pragma "recursive_triggers", mode
|
386
|
+
end
|
387
|
+
|
388
|
+
def reverse_unordered_selects
|
389
|
+
get_boolean_pragma "reverse_unordered_selects"
|
390
|
+
end
|
391
|
+
|
392
|
+
def reverse_unordered_selects=( mode )
|
393
|
+
set_boolean_pragma "reverse_unordered_selects", mode
|
394
|
+
end
|
395
|
+
|
396
|
+
def schema_cookie
|
397
|
+
get_int_pragma "schema_cookie"
|
398
|
+
end
|
399
|
+
|
400
|
+
def schema_cookie=( cookie )
|
401
|
+
set_int_pragma "schema_cookie", cookie
|
402
|
+
end
|
403
|
+
|
404
|
+
def schema_version
|
405
|
+
get_int_pragma "schema_version"
|
406
|
+
end
|
407
|
+
|
408
|
+
def schema_version=( version )
|
409
|
+
set_int_pragma "schema_version", version
|
410
|
+
end
|
411
|
+
|
412
|
+
def secure_delete
|
413
|
+
get_boolean_pragma "secure_delete"
|
414
|
+
end
|
415
|
+
|
416
|
+
def secure_delete=( mode )
|
417
|
+
set_boolean_pragma "secure_delete", mode
|
418
|
+
end
|
419
|
+
|
420
|
+
def short_column_names
|
421
|
+
get_boolean_pragma "short_column_names"
|
422
|
+
end
|
423
|
+
|
424
|
+
def short_column_names=( mode )
|
425
|
+
set_boolean_pragma "short_column_names", mode
|
426
|
+
end
|
427
|
+
|
428
|
+
def shrink_memory
|
429
|
+
execute( "PRAGMA shrink_memory" )
|
430
|
+
end
|
431
|
+
|
432
|
+
def soft_heap_limit
|
433
|
+
get_int_pragma "soft_heap_limit"
|
434
|
+
end
|
435
|
+
|
436
|
+
def soft_heap_limit=( mode )
|
437
|
+
set_int_pragma "soft_heap_limit", mode
|
438
|
+
end
|
439
|
+
|
440
|
+
def stats( &block ) # :yields: row
|
441
|
+
get_query_pragma "stats", &block
|
442
|
+
end
|
443
|
+
|
444
|
+
def synchronous
|
445
|
+
get_enum_pragma "synchronous"
|
446
|
+
end
|
447
|
+
|
448
|
+
def synchronous=( mode )
|
449
|
+
set_enum_pragma "synchronous", mode, SYNCHRONOUS_MODES
|
450
|
+
end
|
451
|
+
|
452
|
+
def temp_store
|
453
|
+
get_enum_pragma "temp_store"
|
454
|
+
end
|
455
|
+
|
456
|
+
def temp_store=( mode )
|
457
|
+
set_enum_pragma "temp_store", mode, TEMP_STORE_MODES
|
458
|
+
end
|
459
|
+
|
460
|
+
def threads
|
461
|
+
get_int_pragma "threads"
|
462
|
+
end
|
463
|
+
|
464
|
+
def threads=( count )
|
465
|
+
set_int_pragma "threads", count
|
466
|
+
end
|
467
|
+
|
468
|
+
def user_cookie
|
469
|
+
get_int_pragma "user_cookie"
|
470
|
+
end
|
471
|
+
|
472
|
+
def user_cookie=( cookie )
|
473
|
+
set_int_pragma "user_cookie", cookie
|
474
|
+
end
|
475
|
+
|
476
|
+
def user_version
|
477
|
+
get_int_pragma "user_version"
|
478
|
+
end
|
479
|
+
|
480
|
+
def user_version=( version )
|
481
|
+
set_int_pragma "user_version", version
|
482
|
+
end
|
483
|
+
|
484
|
+
def vdbe_addoptrace=( mode )
|
485
|
+
set_boolean_pragma "vdbe_addoptrace", mode
|
486
|
+
end
|
487
|
+
|
488
|
+
def vdbe_debug=( mode )
|
489
|
+
set_boolean_pragma "vdbe_debug", mode
|
490
|
+
end
|
491
|
+
|
492
|
+
def vdbe_listing=( mode )
|
493
|
+
set_boolean_pragma "vdbe_listing", mode
|
494
|
+
end
|
495
|
+
|
192
496
|
def vdbe_trace
|
193
497
|
get_boolean_pragma "vdbe_trace"
|
194
498
|
end
|
@@ -197,20 +501,24 @@ module SQLite3
|
|
197
501
|
set_boolean_pragma "vdbe_trace", mode
|
198
502
|
end
|
199
503
|
|
200
|
-
def
|
201
|
-
|
504
|
+
def wal_autocheckpoint
|
505
|
+
get_int_pragma "wal_autocheckpoint"
|
202
506
|
end
|
203
507
|
|
204
|
-
def
|
205
|
-
|
508
|
+
def wal_autocheckpoint=( mode )
|
509
|
+
set_int_pragma "wal_autocheckpoint", mode
|
206
510
|
end
|
207
511
|
|
208
|
-
def
|
209
|
-
|
512
|
+
def wal_checkpoint
|
513
|
+
get_enum_pragma "wal_checkpoint"
|
210
514
|
end
|
211
515
|
|
212
|
-
def
|
213
|
-
|
516
|
+
def wal_checkpoint=( mode )
|
517
|
+
set_enum_pragma "wal_checkpoint", mode, WAL_CHECKPOINTS
|
518
|
+
end
|
519
|
+
|
520
|
+
def writable_schema=( mode )
|
521
|
+
set_boolean_pragma "writable_schema", mode
|
214
522
|
end
|
215
523
|
|
216
524
|
###
|
@@ -235,6 +543,13 @@ module SQLite3
|
|
235
543
|
|
236
544
|
tweak_default(new_row) if needs_tweak_default
|
237
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
|
+
|
238
553
|
if block_given?
|
239
554
|
yield new_row
|
240
555
|
else
|
data/lib/sqlite3/resultset.rb
CHANGED
@@ -108,11 +108,7 @@ object that created this object
|
|
108
108
|
row = @stmt.step
|
109
109
|
return nil if @stmt.done?
|
110
110
|
|
111
|
-
|
112
|
-
row = @stmt.types.zip(row).map do |type, value|
|
113
|
-
@db.translator.translate( type, value )
|
114
|
-
end
|
115
|
-
end
|
111
|
+
row = @db.translate_from_db @stmt.types, row
|
116
112
|
|
117
113
|
if row.respond_to?(:fields)
|
118
114
|
# FIXME: this can only happen if the translator returns something
|
@@ -176,11 +172,7 @@ object that created this object
|
|
176
172
|
|
177
173
|
# FIXME: type translation is deprecated, so this can be removed
|
178
174
|
# in 2.0
|
179
|
-
|
180
|
-
row = @stmt.types.zip(row).map do |type, value|
|
181
|
-
@db.translator.translate( type, value )
|
182
|
-
end
|
183
|
-
end
|
175
|
+
row = @db.translate_from_db @stmt.types, row
|
184
176
|
|
185
177
|
# FIXME: this can be switched to a regular hash in 2.0
|
186
178
|
row = HashWithTypesAndFields[*@stmt.columns.zip(row).flatten]
|
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
@@ -1,13 +1,13 @@
|
|
1
1
|
module SQLite3
|
2
2
|
|
3
|
-
VERSION =
|
3
|
+
VERSION = "1.5.0.rc1"
|
4
4
|
|
5
5
|
module VersionProxy
|
6
6
|
|
7
7
|
MAJOR = 1
|
8
|
-
MINOR =
|
9
|
-
TINY =
|
10
|
-
BUILD =
|
8
|
+
MINOR = 5
|
9
|
+
TINY = 0
|
10
|
+
BUILD = "rc1"
|
11
11
|
|
12
12
|
STRING = [ MAJOR, MINOR, TINY, BUILD ].compact.join( "." )
|
13
13
|
#:beta-tag:
|
data/lib/sqlite3.rb
CHANGED
data/test/helper.rb
CHANGED
@@ -1,6 +1,15 @@
|
|
1
1
|
require 'sqlite3'
|
2
2
|
require 'minitest/autorun'
|
3
3
|
|
4
|
+
if ENV['GITHUB_ACTIONS'] == 'true' || ENV['CI']
|
5
|
+
$VERBOSE = nil
|
6
|
+
end
|
7
|
+
|
8
|
+
puts "info: sqlite3-ruby version: #{SQLite3::VERSION}/#{SQLite3::VersionProxy::STRING}"
|
9
|
+
puts "info: sqlite3 version: #{SQLite3::SQLITE_VERSION}/#{SQLite3::SQLITE_LOADED_VERSION}"
|
10
|
+
puts "info: sqlcipher?: #{SQLite3.sqlcipher?}"
|
11
|
+
puts "info: threadsafe?: #{SQLite3.threadsafe?}"
|
12
|
+
|
4
13
|
unless RUBY_VERSION >= "1.9"
|
5
14
|
require 'iconv'
|
6
15
|
end
|