acts-as-messageable 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,1673 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `sqlite3` gem.
5
+ # Please instead update this file by running `bin/tapioca gem sqlite3`.
6
+
7
+ # source://sqlite3//lib/sqlite3/constants.rb#1
8
+ module SQLite3
9
+ class << self
10
+ # source://sqlite3//lib/sqlite3/version.rb#16
11
+ def const_missing(name); end
12
+
13
+ def libversion; end
14
+ def sqlcipher?; end
15
+ def threadsafe; end
16
+
17
+ # Was sqlite3 compiled with thread safety on?
18
+ #
19
+ # @return [Boolean]
20
+ #
21
+ # source://sqlite3//lib/sqlite3.rb#14
22
+ def threadsafe?; end
23
+ end
24
+ end
25
+
26
+ # source://sqlite3//lib/sqlite3/errors.rb#12
27
+ class SQLite3::AbortException < ::SQLite3::Exception; end
28
+
29
+ # source://sqlite3//lib/sqlite3/errors.rb#31
30
+ class SQLite3::AuthorizationException < ::SQLite3::Exception; end
31
+
32
+ class SQLite3::Backup
33
+ def initialize(_arg0, _arg1, _arg2, _arg3); end
34
+
35
+ def finish; end
36
+ def pagecount; end
37
+ def remaining; end
38
+ def step(_arg0); end
39
+ end
40
+
41
+ class SQLite3::Blob < ::String; end
42
+
43
+ # source://sqlite3//lib/sqlite3/errors.rb#13
44
+ class SQLite3::BusyException < ::SQLite3::Exception; end
45
+
46
+ # source://sqlite3//lib/sqlite3/errors.rb#22
47
+ class SQLite3::CantOpenException < ::SQLite3::Exception; end
48
+
49
+ # source://sqlite3//lib/sqlite3/constants.rb#1
50
+ module SQLite3::Constants; end
51
+
52
+ # source://sqlite3//lib/sqlite3/constants.rb#12
53
+ module SQLite3::Constants::ColumnType; end
54
+
55
+ # source://sqlite3//lib/sqlite3/constants.rb#16
56
+ SQLite3::Constants::ColumnType::BLOB = T.let(T.unsafe(nil), Integer)
57
+
58
+ # source://sqlite3//lib/sqlite3/constants.rb#14
59
+ SQLite3::Constants::ColumnType::FLOAT = T.let(T.unsafe(nil), Integer)
60
+
61
+ # source://sqlite3//lib/sqlite3/constants.rb#13
62
+ SQLite3::Constants::ColumnType::INTEGER = T.let(T.unsafe(nil), Integer)
63
+
64
+ # source://sqlite3//lib/sqlite3/constants.rb#17
65
+ SQLite3::Constants::ColumnType::NULL = T.let(T.unsafe(nil), Integer)
66
+
67
+ # source://sqlite3//lib/sqlite3/constants.rb#15
68
+ SQLite3::Constants::ColumnType::TEXT = T.let(T.unsafe(nil), Integer)
69
+
70
+ # source://sqlite3//lib/sqlite3/constants.rb#20
71
+ module SQLite3::Constants::ErrorCode; end
72
+
73
+ # Callback routine requested an abort
74
+ #
75
+ # source://sqlite3//lib/sqlite3/constants.rb#25
76
+ SQLite3::Constants::ErrorCode::ABORT = T.let(T.unsafe(nil), Integer)
77
+
78
+ # Authorization denied
79
+ #
80
+ # source://sqlite3//lib/sqlite3/constants.rb#44
81
+ SQLite3::Constants::ErrorCode::AUTH = T.let(T.unsafe(nil), Integer)
82
+
83
+ # The database file is locked
84
+ #
85
+ # source://sqlite3//lib/sqlite3/constants.rb#26
86
+ SQLite3::Constants::ErrorCode::BUSY = T.let(T.unsafe(nil), Integer)
87
+
88
+ # Unable to open the database file
89
+ #
90
+ # source://sqlite3//lib/sqlite3/constants.rb#35
91
+ SQLite3::Constants::ErrorCode::CANTOPEN = T.let(T.unsafe(nil), Integer)
92
+
93
+ # Abort due to constraint violation
94
+ #
95
+ # source://sqlite3//lib/sqlite3/constants.rb#40
96
+ SQLite3::Constants::ErrorCode::CONSTRAINT = T.let(T.unsafe(nil), Integer)
97
+
98
+ # The database disk image is malformed
99
+ #
100
+ # source://sqlite3//lib/sqlite3/constants.rb#32
101
+ SQLite3::Constants::ErrorCode::CORRUPT = T.let(T.unsafe(nil), Integer)
102
+
103
+ # sqlite_step() has finished executing
104
+ #
105
+ # source://sqlite3//lib/sqlite3/constants.rb#47
106
+ SQLite3::Constants::ErrorCode::DONE = T.let(T.unsafe(nil), Integer)
107
+
108
+ # (Internal Only) Database table is empty
109
+ #
110
+ # source://sqlite3//lib/sqlite3/constants.rb#37
111
+ SQLite3::Constants::ErrorCode::EMPTY = T.let(T.unsafe(nil), Integer)
112
+
113
+ # SQL error or missing database
114
+ #
115
+ # source://sqlite3//lib/sqlite3/constants.rb#22
116
+ SQLite3::Constants::ErrorCode::ERROR = T.let(T.unsafe(nil), Integer)
117
+
118
+ # Insertion failed because database is full
119
+ #
120
+ # source://sqlite3//lib/sqlite3/constants.rb#34
121
+ SQLite3::Constants::ErrorCode::FULL = T.let(T.unsafe(nil), Integer)
122
+
123
+ # An internal logic error in SQLite
124
+ #
125
+ # source://sqlite3//lib/sqlite3/constants.rb#23
126
+ SQLite3::Constants::ErrorCode::INTERNAL = T.let(T.unsafe(nil), Integer)
127
+
128
+ # Operation terminated by sqlite_interrupt()
129
+ #
130
+ # source://sqlite3//lib/sqlite3/constants.rb#30
131
+ SQLite3::Constants::ErrorCode::INTERRUPT = T.let(T.unsafe(nil), Integer)
132
+
133
+ # Some kind of disk I/O error occurred
134
+ #
135
+ # source://sqlite3//lib/sqlite3/constants.rb#31
136
+ SQLite3::Constants::ErrorCode::IOERR = T.let(T.unsafe(nil), Integer)
137
+
138
+ # A table in the database is locked
139
+ #
140
+ # source://sqlite3//lib/sqlite3/constants.rb#27
141
+ SQLite3::Constants::ErrorCode::LOCKED = T.let(T.unsafe(nil), Integer)
142
+
143
+ # Data type mismatch
144
+ #
145
+ # source://sqlite3//lib/sqlite3/constants.rb#41
146
+ SQLite3::Constants::ErrorCode::MISMATCH = T.let(T.unsafe(nil), Integer)
147
+
148
+ # Library used incorrectly
149
+ #
150
+ # source://sqlite3//lib/sqlite3/constants.rb#42
151
+ SQLite3::Constants::ErrorCode::MISUSE = T.let(T.unsafe(nil), Integer)
152
+
153
+ # Uses OS features not supported on host
154
+ #
155
+ # source://sqlite3//lib/sqlite3/constants.rb#43
156
+ SQLite3::Constants::ErrorCode::NOLFS = T.let(T.unsafe(nil), Integer)
157
+
158
+ # A malloc() failed
159
+ #
160
+ # source://sqlite3//lib/sqlite3/constants.rb#28
161
+ SQLite3::Constants::ErrorCode::NOMEM = T.let(T.unsafe(nil), Integer)
162
+
163
+ # (Internal Only) Table or record not found
164
+ #
165
+ # source://sqlite3//lib/sqlite3/constants.rb#33
166
+ SQLite3::Constants::ErrorCode::NOTFOUND = T.let(T.unsafe(nil), Integer)
167
+
168
+ # Successful result
169
+ #
170
+ # source://sqlite3//lib/sqlite3/constants.rb#21
171
+ SQLite3::Constants::ErrorCode::OK = T.let(T.unsafe(nil), Integer)
172
+
173
+ # Access permission denied
174
+ #
175
+ # source://sqlite3//lib/sqlite3/constants.rb#24
176
+ SQLite3::Constants::ErrorCode::PERM = T.let(T.unsafe(nil), Integer)
177
+
178
+ # Database lock protocol error
179
+ #
180
+ # source://sqlite3//lib/sqlite3/constants.rb#36
181
+ SQLite3::Constants::ErrorCode::PROTOCOL = T.let(T.unsafe(nil), Integer)
182
+
183
+ # Attempt to write a readonly database
184
+ #
185
+ # source://sqlite3//lib/sqlite3/constants.rb#29
186
+ SQLite3::Constants::ErrorCode::READONLY = T.let(T.unsafe(nil), Integer)
187
+
188
+ # sqlite_step() has another row ready
189
+ #
190
+ # source://sqlite3//lib/sqlite3/constants.rb#46
191
+ SQLite3::Constants::ErrorCode::ROW = T.let(T.unsafe(nil), Integer)
192
+
193
+ # The database schema changed
194
+ #
195
+ # source://sqlite3//lib/sqlite3/constants.rb#38
196
+ SQLite3::Constants::ErrorCode::SCHEMA = T.let(T.unsafe(nil), Integer)
197
+
198
+ # Too much data for one row of a table
199
+ #
200
+ # source://sqlite3//lib/sqlite3/constants.rb#39
201
+ SQLite3::Constants::ErrorCode::TOOBIG = T.let(T.unsafe(nil), Integer)
202
+
203
+ module SQLite3::Constants::Open; end
204
+ SQLite3::Constants::Open::AUTOPROXY = T.let(T.unsafe(nil), Integer)
205
+ SQLite3::Constants::Open::CREATE = T.let(T.unsafe(nil), Integer)
206
+ SQLite3::Constants::Open::DELETEONCLOSE = T.let(T.unsafe(nil), Integer)
207
+ SQLite3::Constants::Open::EXCLUSIVE = T.let(T.unsafe(nil), Integer)
208
+ SQLite3::Constants::Open::FULLMUTEX = T.let(T.unsafe(nil), Integer)
209
+ SQLite3::Constants::Open::MAIN_DB = T.let(T.unsafe(nil), Integer)
210
+ SQLite3::Constants::Open::MAIN_JOURNAL = T.let(T.unsafe(nil), Integer)
211
+ SQLite3::Constants::Open::MASTER_JOURNAL = T.let(T.unsafe(nil), Integer)
212
+ SQLite3::Constants::Open::MEMORY = T.let(T.unsafe(nil), Integer)
213
+ SQLite3::Constants::Open::NOMUTEX = T.let(T.unsafe(nil), Integer)
214
+ SQLite3::Constants::Open::PRIVATECACHE = T.let(T.unsafe(nil), Integer)
215
+ SQLite3::Constants::Open::READONLY = T.let(T.unsafe(nil), Integer)
216
+ SQLite3::Constants::Open::READWRITE = T.let(T.unsafe(nil), Integer)
217
+ SQLite3::Constants::Open::SHAREDCACHE = T.let(T.unsafe(nil), Integer)
218
+ SQLite3::Constants::Open::SUBJOURNAL = T.let(T.unsafe(nil), Integer)
219
+ SQLite3::Constants::Open::TEMP_DB = T.let(T.unsafe(nil), Integer)
220
+ SQLite3::Constants::Open::TEMP_JOURNAL = T.let(T.unsafe(nil), Integer)
221
+ SQLite3::Constants::Open::TRANSIENT_DB = T.let(T.unsafe(nil), Integer)
222
+ SQLite3::Constants::Open::URI = T.let(T.unsafe(nil), Integer)
223
+ SQLite3::Constants::Open::WAL = T.let(T.unsafe(nil), Integer)
224
+
225
+ # source://sqlite3//lib/sqlite3/constants.rb#3
226
+ module SQLite3::Constants::TextRep; end
227
+
228
+ # source://sqlite3//lib/sqlite3/constants.rb#8
229
+ SQLite3::Constants::TextRep::ANY = T.let(T.unsafe(nil), Integer)
230
+
231
+ # source://sqlite3//lib/sqlite3/constants.rb#9
232
+ SQLite3::Constants::TextRep::DETERMINISTIC = T.let(T.unsafe(nil), Integer)
233
+
234
+ # source://sqlite3//lib/sqlite3/constants.rb#7
235
+ SQLite3::Constants::TextRep::UTF16 = T.let(T.unsafe(nil), Integer)
236
+
237
+ # source://sqlite3//lib/sqlite3/constants.rb#6
238
+ SQLite3::Constants::TextRep::UTF16BE = T.let(T.unsafe(nil), Integer)
239
+
240
+ # source://sqlite3//lib/sqlite3/constants.rb#5
241
+ SQLite3::Constants::TextRep::UTF16LE = T.let(T.unsafe(nil), Integer)
242
+
243
+ # source://sqlite3//lib/sqlite3/constants.rb#4
244
+ SQLite3::Constants::TextRep::UTF8 = T.let(T.unsafe(nil), Integer)
245
+
246
+ # source://sqlite3//lib/sqlite3/errors.rb#27
247
+ class SQLite3::ConstraintException < ::SQLite3::Exception; end
248
+
249
+ # source://sqlite3//lib/sqlite3/errors.rb#19
250
+ class SQLite3::CorruptException < ::SQLite3::Exception; end
251
+
252
+ # The Database class encapsulates a single connection to a SQLite3 database.
253
+ # Its usage is very straightforward:
254
+ #
255
+ # require 'sqlite3'
256
+ #
257
+ # SQLite3::Database.new( "data.db" ) do |db|
258
+ # db.execute( "select * from table" ) do |row|
259
+ # p row
260
+ # end
261
+ # end
262
+ #
263
+ # It wraps the lower-level methods provides by the selected driver, and
264
+ # includes the Pragmas module for access to various pragma convenience
265
+ # methods.
266
+ #
267
+ # The Database class provides type translation services as well, by which
268
+ # the SQLite3 data types (which are all represented as strings) may be
269
+ # converted into their corresponding types (as defined in the schemas
270
+ # for their tables). This translation only occurs when querying data from
271
+ # the database--insertions and updates are all still typeless.
272
+ #
273
+ # Furthermore, the Database class has been designed to work well with the
274
+ # ArrayFields module from Ara Howard. If you require the ArrayFields
275
+ # module before performing a query, and if you have not enabled results as
276
+ # hashes, then the results will all be indexible by field name.
277
+ #
278
+ # source://sqlite3//lib/sqlite3/database.rb#35
279
+ class SQLite3::Database
280
+ include ::SQLite3::Pragmas
281
+
282
+ # call-seq: SQLite3::Database.new(file, options = {})
283
+ #
284
+ # Create a new Database object that opens the given file. If utf16
285
+ # is +true+, the filename is interpreted as a UTF-16 encoded string.
286
+ #
287
+ # By default, the new database will return result rows as arrays
288
+ # (#results_as_hash) and has type translation disabled (#type_translation=).
289
+ #
290
+ # @return [Database] a new instance of Database
291
+ #
292
+ # source://sqlite3//lib/sqlite3/database.rb#65
293
+ def initialize(file, options = T.unsafe(nil), zvfs = T.unsafe(nil)); end
294
+
295
+ # Installs (or removes) a block that will be invoked for every access
296
+ # to the database. If the block returns 0 (or +nil+), the statement
297
+ # is allowed to proceed. Returning 1 causes an authorization error to
298
+ # occur, and returning 2 causes the access to be silently denied.
299
+ #
300
+ # source://sqlite3//lib/sqlite3/database.rb#142
301
+ def authorizer(&block); end
302
+
303
+ def authorizer=(_arg0); end
304
+ def busy_handler(*_arg0); end
305
+ def busy_timeout(_arg0); end
306
+ def busy_timeout=(_arg0); end
307
+ def changes; end
308
+ def close; end
309
+ def closed?; end
310
+ def collation(_arg0, _arg1); end
311
+
312
+ # Returns the value of attribute collations.
313
+ #
314
+ # source://sqlite3//lib/sqlite3/database.rb#36
315
+ def collations; end
316
+
317
+ # Commits the current transaction. If there is no current transaction,
318
+ # this will cause an error to be raised. This returns +true+, in order
319
+ # to allow it to be used in idioms like
320
+ # <tt>abort? and rollback or commit</tt>.
321
+ #
322
+ # source://sqlite3//lib/sqlite3/database.rb#654
323
+ def commit; end
324
+
325
+ def complete?(_arg0); end
326
+
327
+ # Creates a new aggregate function for use in SQL statements. Aggregate
328
+ # functions are functions that apply over every row in the result set,
329
+ # instead of over just a single row. (A very common aggregate function
330
+ # is the "count" function, for determining the number of rows that match
331
+ # a query.)
332
+ #
333
+ # The new function will be added as +name+, with the given +arity+. (For
334
+ # variable arity functions, use -1 for the arity.)
335
+ #
336
+ # The +step+ parameter must be a proc object that accepts as its first
337
+ # parameter a FunctionProxy instance (representing the function
338
+ # invocation), with any subsequent parameters (up to the function's arity).
339
+ # The +step+ callback will be invoked once for each row of the result set.
340
+ #
341
+ # The +finalize+ parameter must be a +proc+ object that accepts only a
342
+ # single parameter, the FunctionProxy instance representing the current
343
+ # function invocation. It should invoke FunctionProxy#result= to
344
+ # store the result of the function.
345
+ #
346
+ # Example:
347
+ #
348
+ # db.create_aggregate( "lengths", 1 ) do
349
+ # step do |func, value|
350
+ # func[ :total ] ||= 0
351
+ # func[ :total ] += ( value ? value.length : 0 )
352
+ # end
353
+ #
354
+ # finalize do |func|
355
+ # func.result = func[ :total ] || 0
356
+ # end
357
+ # end
358
+ #
359
+ # puts db.get_first_value( "select lengths(name) from table" )
360
+ #
361
+ # See also #create_aggregate_handler for a more object-oriented approach to
362
+ # aggregate functions.
363
+ #
364
+ # source://sqlite3//lib/sqlite3/database.rb#445
365
+ def create_aggregate(name, arity, step = T.unsafe(nil), finalize = T.unsafe(nil), text_rep = T.unsafe(nil), &block); end
366
+
367
+ # This is another approach to creating an aggregate function (see
368
+ # #create_aggregate). Instead of explicitly specifying the name,
369
+ # callbacks, arity, and type, you specify a factory object
370
+ # (the "handler") that knows how to obtain all of that information. The
371
+ # handler should respond to the following messages:
372
+ #
373
+ # +arity+:: corresponds to the +arity+ parameter of #create_aggregate. This
374
+ # message is optional, and if the handler does not respond to it,
375
+ # the function will have an arity of -1.
376
+ # +name+:: this is the name of the function. The handler _must_ implement
377
+ # this message.
378
+ # +new+:: this must be implemented by the handler. It should return a new
379
+ # instance of the object that will handle a specific invocation of
380
+ # the function.
381
+ #
382
+ # The handler instance (the object returned by the +new+ message, described
383
+ # above), must respond to the following messages:
384
+ #
385
+ # +step+:: this is the method that will be called for each step of the
386
+ # aggregate function's evaluation. It should implement the same
387
+ # signature as the +step+ callback for #create_aggregate.
388
+ # +finalize+:: this is the method that will be called to finalize the
389
+ # aggregate function's evaluation. It should implement the
390
+ # same signature as the +finalize+ callback for
391
+ # #create_aggregate.
392
+ #
393
+ # Example:
394
+ #
395
+ # class LengthsAggregateHandler
396
+ # def self.arity; 1; end
397
+ # def self.name; 'lengths'; end
398
+ #
399
+ # def initialize
400
+ # @total = 0
401
+ # end
402
+ #
403
+ # def step( ctx, name )
404
+ # @total += ( name ? name.length : 0 )
405
+ # end
406
+ #
407
+ # def finalize( ctx )
408
+ # ctx.result = @total
409
+ # end
410
+ # end
411
+ #
412
+ # db.create_aggregate_handler( LengthsAggregateHandler )
413
+ # puts db.get_first_value( "select lengths(name) from A" )
414
+ #
415
+ # source://sqlite3//lib/sqlite3/database.rb#543
416
+ def create_aggregate_handler(handler); end
417
+
418
+ # Creates a new function for use in SQL statements. It will be added as
419
+ # +name+, with the given +arity+. (For variable arity functions, use
420
+ # -1 for the arity.)
421
+ #
422
+ # The block should accept at least one parameter--the FunctionProxy
423
+ # instance that wraps this function invocation--and any other
424
+ # arguments it needs (up to its arity).
425
+ #
426
+ # The block does not return a value directly. Instead, it will invoke
427
+ # the FunctionProxy#result= method on the +func+ parameter and
428
+ # indicate the return value that way.
429
+ #
430
+ # Example:
431
+ #
432
+ # db.create_function( "maim", 1 ) do |func, value|
433
+ # if value.nil?
434
+ # func.result = nil
435
+ # else
436
+ # func.result = value.split(//).sort.join
437
+ # end
438
+ # end
439
+ #
440
+ # puts db.get_first_value( "select maim(name) from table" )
441
+ #
442
+ # source://sqlite3//lib/sqlite3/database.rb#400
443
+ def create_function(name, arity, text_rep = T.unsafe(nil), &block); end
444
+
445
+ # Define an aggregate function named +name+ using a object template
446
+ # object +aggregator+. +aggregator+ must respond to +step+ and +finalize+.
447
+ # +step+ will be called with row information and +finalize+ must return the
448
+ # return value for the aggregator function.
449
+ #
450
+ # _API Change:_ +aggregator+ must also implement +clone+. The provided
451
+ # +aggregator+ object will serve as template that is cloned to provide the
452
+ # individual instances of the aggregate function. Regular ruby objects
453
+ # already provide a suitable +clone+.
454
+ # The functions arity is the arity of the +step+ method.
455
+ #
456
+ # source://sqlite3//lib/sqlite3/database.rb#580
457
+ def define_aggregator(name, aggregator); end
458
+
459
+ def define_function(_arg0); end
460
+ def define_function_with_flags(_arg0, _arg1); end
461
+ def enable_load_extension(_arg0); end
462
+ def encoding; end
463
+ def errcode; end
464
+ def errmsg; end
465
+
466
+ # Executes the given SQL statement. If additional parameters are given,
467
+ # they are treated as bind variables, and are bound to the placeholders in
468
+ # the query.
469
+ #
470
+ # Note that if any of the values passed to this are hashes, then the
471
+ # key/value pairs are each bound separately, with the key being used as
472
+ # the name of the placeholder to bind the value to.
473
+ #
474
+ # The block is optional. If given, it will be invoked for each row returned
475
+ # by the query. Otherwise, any results are accumulated into an array and
476
+ # returned wholesale.
477
+ #
478
+ # See also #execute2, #query, and #execute_batch for additional ways of
479
+ # executing statements.
480
+ #
481
+ # source://sqlite3//lib/sqlite3/database.rb#183
482
+ def execute(sql, bind_vars = T.unsafe(nil), *args, &block); end
483
+
484
+ # Executes the given SQL statement, exactly as with #execute. However, the
485
+ # first row returned (either via the block, or in the returned array) is
486
+ # always the names of the columns. Subsequent rows correspond to the data
487
+ # from the result set.
488
+ #
489
+ # Thus, even if the query itself returns no rows, this method will always
490
+ # return at least one row--the names of the columns.
491
+ #
492
+ # See also #execute, #query, and #execute_batch for additional ways of
493
+ # executing statements.
494
+ #
495
+ # source://sqlite3//lib/sqlite3/database.rb#222
496
+ def execute2(sql, *bind_vars); end
497
+
498
+ # Executes all SQL statements in the given string. By contrast, the other
499
+ # means of executing queries will only execute the first statement in the
500
+ # string, ignoring all subsequent statements. This will execute each one
501
+ # in turn. The same bind parameters, if given, will be applied to each
502
+ # statement.
503
+ #
504
+ # This always returns +nil+, making it unsuitable for queries that return
505
+ # rows.
506
+ #
507
+ # See also #execute_batch2 for additional ways of
508
+ # executing statements.
509
+ #
510
+ # source://sqlite3//lib/sqlite3/database.rb#246
511
+ def execute_batch(sql, bind_vars = T.unsafe(nil), *args); end
512
+
513
+ # Executes all SQL statements in the given string. By contrast, the other
514
+ # means of executing queries will only execute the first statement in the
515
+ # string, ignoring all subsequent statements. This will execute each one
516
+ # in turn. Bind parameters cannot be passed to #execute_batch2.
517
+ #
518
+ # If a query is made, all values will be returned as strings.
519
+ # If no query is made, an empty array will be returned.
520
+ #
521
+ # Because all values except for 'NULL' are returned as strings,
522
+ # a block can be passed to parse the values accordingly.
523
+ #
524
+ # See also #execute_batch for additional ways of
525
+ # executing statements.
526
+ #
527
+ # source://sqlite3//lib/sqlite3/database.rb#303
528
+ def execute_batch2(sql, &block); end
529
+
530
+ def extended_result_codes=(_arg0); end
531
+
532
+ # Returns the filename for the database named +db_name+. +db_name+ defaults
533
+ # to "main". Main return `nil` or an empty string if the database is
534
+ # temporary or in-memory.
535
+ #
536
+ # source://sqlite3//lib/sqlite3/database.rb#165
537
+ def filename(db_name = T.unsafe(nil)); end
538
+
539
+ # A convenience method for obtaining the first row of a result set, and
540
+ # discarding all others. It is otherwise identical to #execute.
541
+ #
542
+ # See also #get_first_value.
543
+ #
544
+ # source://sqlite3//lib/sqlite3/database.rb#357
545
+ def get_first_row(sql, *bind_vars); end
546
+
547
+ # A convenience method for obtaining the first value of the first row of a
548
+ # result set, and discarding all other values and rows. It is otherwise
549
+ # identical to #execute.
550
+ #
551
+ # See also #get_first_row.
552
+ #
553
+ # source://sqlite3//lib/sqlite3/database.rb#366
554
+ def get_first_value(sql, *bind_vars); end
555
+
556
+ def interrupt; end
557
+ def last_insert_row_id; end
558
+ def load_extension(_arg0); end
559
+
560
+ # Returns a Statement object representing the given SQL. This does not
561
+ # execute the statement; it merely prepares the statement for execution.
562
+ #
563
+ # The Statement can then be executed using Statement#execute.
564
+ #
565
+ # source://sqlite3//lib/sqlite3/database.rb#151
566
+ def prepare(sql); end
567
+
568
+ # This is a convenience method for creating a statement, binding
569
+ # parameters to it, and calling execute:
570
+ #
571
+ # result = db.query( "select * from foo where a=?", [5])
572
+ # # is the same as
573
+ # result = db.prepare( "select * from foo where a=?" ).execute( 5 )
574
+ #
575
+ # You must be sure to call +close+ on the ResultSet instance that is
576
+ # returned, or you could have problems with locks on the table. If called
577
+ # with a block, +close+ will be invoked implicitly when the block
578
+ # terminates.
579
+ #
580
+ # source://sqlite3//lib/sqlite3/database.rb#325
581
+ def query(sql, bind_vars = T.unsafe(nil), *args); end
582
+
583
+ # Returns +true+ if the database has been open in readonly mode
584
+ # A helper to check before performing any operation
585
+ #
586
+ # @return [Boolean]
587
+ #
588
+ # source://sqlite3//lib/sqlite3/database.rb#670
589
+ def readonly?; end
590
+
591
+ # A boolean that indicates whether rows in result sets should be returned
592
+ # as hashes or not. By default, rows are returned as arrays.
593
+ #
594
+ # source://sqlite3//lib/sqlite3/database.rb#55
595
+ def results_as_hash; end
596
+
597
+ # A boolean that indicates whether rows in result sets should be returned
598
+ # as hashes or not. By default, rows are returned as arrays.
599
+ #
600
+ # source://sqlite3//lib/sqlite3/database.rb#55
601
+ def results_as_hash=(_arg0); end
602
+
603
+ # Rolls the current transaction back. If there is no current transaction,
604
+ # this will cause an error to be raised. This returns +true+, in order
605
+ # to allow it to be used in idioms like
606
+ # <tt>abort? and rollback or commit</tt>.
607
+ #
608
+ # source://sqlite3//lib/sqlite3/database.rb#663
609
+ def rollback; end
610
+
611
+ def total_changes; end
612
+ def trace(*_arg0); end
613
+
614
+ # Begins a new transaction. Note that nested transactions are not allowed
615
+ # by SQLite, so attempting to nest a transaction will result in a runtime
616
+ # exception.
617
+ #
618
+ # The +mode+ parameter may be either <tt>:deferred</tt> (the default),
619
+ # <tt>:immediate</tt>, or <tt>:exclusive</tt>.
620
+ #
621
+ # If a block is given, the database instance is yielded to it, and the
622
+ # transaction is committed when the block terminates. If the block
623
+ # raises an exception, a rollback will be performed instead. Note that if
624
+ # a block is given, #commit and #rollback should never be called
625
+ # explicitly or you'll get an error when the block terminates.
626
+ #
627
+ # If a block is not given, it is the caller's responsibility to end the
628
+ # transaction explicitly, either by calling #commit, or by calling
629
+ # #rollback.
630
+ #
631
+ # source://sqlite3//lib/sqlite3/database.rb#632
632
+ def transaction(mode = T.unsafe(nil)); end
633
+
634
+ def transaction_active?; end
635
+
636
+ # Translates a +row+ of data from the database with the given +types+
637
+ #
638
+ # source://sqlite3//lib/sqlite3/database.rb#721
639
+ def translate_from_db(types, row); end
640
+
641
+ # Return the type translator employed by this database instance. Each
642
+ # database instance has its own type translator; this allows for different
643
+ # type handlers to be installed in each instance without affecting other
644
+ # instances. Furthermore, the translators are instantiated lazily, so that
645
+ # if a database does not use type translation, it will not be burdened by
646
+ # the overhead of a useless type translator. (See the Translator class.)
647
+ #
648
+ # source://sqlite3//lib/sqlite3/database.rb#134
649
+ def translator; end
650
+
651
+ # source://sqlite3//lib/sqlite3/database.rb#126
652
+ def type_translation; end
653
+
654
+ # source://sqlite3//lib/sqlite3/database.rb#117
655
+ def type_translation=(value); end
656
+
657
+ private
658
+
659
+ def db_filename(_arg0); end
660
+ def define_aggregator2(_arg0, _arg1); end
661
+ def disable_quirk_mode; end
662
+ def exec_batch(_arg0, _arg1); end
663
+
664
+ # source://sqlite3//lib/sqlite3/database.rb#729
665
+ def make_type_translator(should_translate); end
666
+
667
+ def open16(_arg0); end
668
+ def open_v2(_arg0, _arg1, _arg2); end
669
+
670
+ class << self
671
+ def open(*_arg0); end
672
+
673
+ # Quotes the given string, making it safe to use in an SQL statement.
674
+ # It replaces all instances of the single-quote character with two
675
+ # single-quote characters. The modified string is returned.
676
+ #
677
+ # source://sqlite3//lib/sqlite3/database.rb#47
678
+ def quote(string); end
679
+ end
680
+ end
681
+
682
+ # A helper class for dealing with custom functions (see #create_function,
683
+ # #create_aggregate, and #create_aggregate_handler). It encapsulates the
684
+ # opaque function object that represents the current invocation. It also
685
+ # provides more convenient access to the API functions that operate on
686
+ # the function object.
687
+ #
688
+ # This class will almost _always_ be instantiated indirectly, by working
689
+ # with the create methods mentioned above.
690
+ #
691
+ # source://sqlite3//lib/sqlite3/database.rb#682
692
+ class SQLite3::Database::FunctionProxy
693
+ # Create a new FunctionProxy that encapsulates the given +func+ object.
694
+ # If context is non-nil, the functions context will be set to that. If
695
+ # it is non-nil, it must quack like a Hash. If it is nil, then none of
696
+ # the context functions will be available.
697
+ #
698
+ # @return [FunctionProxy] a new instance of FunctionProxy
699
+ #
700
+ # source://sqlite3//lib/sqlite3/database.rb#689
701
+ def initialize; end
702
+
703
+ # Returns the value with the given key from the context. This is only
704
+ # available to aggregate functions.
705
+ #
706
+ # source://sqlite3//lib/sqlite3/database.rb#709
707
+ def [](key); end
708
+
709
+ # Sets the value with the given key in the context. This is only
710
+ # available to aggregate functions.
711
+ #
712
+ # source://sqlite3//lib/sqlite3/database.rb#715
713
+ def []=(key, value); end
714
+
715
+ # (Only available to aggregate functions.) Returns the number of rows
716
+ # that the aggregate has processed so far. This will include the current
717
+ # row, and so will always return at least 1.
718
+ #
719
+ # source://sqlite3//lib/sqlite3/database.rb#703
720
+ def count; end
721
+
722
+ # Returns the value of attribute result.
723
+ #
724
+ # source://sqlite3//lib/sqlite3/database.rb#683
725
+ def result; end
726
+
727
+ # Sets the attribute result
728
+ #
729
+ # @param value the value to set the attribute result to.
730
+ #
731
+ # source://sqlite3//lib/sqlite3/database.rb#683
732
+ def result=(_arg0); end
733
+
734
+ # Set the result of the function to the given error message.
735
+ # The function will then return that error.
736
+ #
737
+ # source://sqlite3//lib/sqlite3/database.rb#696
738
+ def set_error(error); end
739
+ end
740
+
741
+ # source://sqlite3//lib/sqlite3/database.rb#727
742
+ SQLite3::Database::NULL_TRANSLATOR = T.let(T.unsafe(nil), Proc)
743
+
744
+ # source://sqlite3//lib/sqlite3/errors.rb#24
745
+ class SQLite3::EmptyException < ::SQLite3::Exception; end
746
+
747
+ # source://sqlite3//lib/sqlite3/errors.rb#4
748
+ class SQLite3::Exception < ::StandardError
749
+ # A convenience for accessing the error code for this exception.
750
+ #
751
+ # source://sqlite3//lib/sqlite3/errors.rb#6
752
+ def code; end
753
+ end
754
+
755
+ # source://sqlite3//lib/sqlite3/errors.rb#32
756
+ class SQLite3::FormatException < ::SQLite3::Exception; end
757
+
758
+ # source://sqlite3//lib/sqlite3/errors.rb#21
759
+ class SQLite3::FullException < ::SQLite3::Exception; end
760
+
761
+ # source://sqlite3//lib/sqlite3/errors.rb#18
762
+ class SQLite3::IOException < ::SQLite3::Exception; end
763
+
764
+ # source://sqlite3//lib/sqlite3/errors.rb#10
765
+ class SQLite3::InternalException < ::SQLite3::Exception; end
766
+
767
+ # source://sqlite3//lib/sqlite3/errors.rb#17
768
+ class SQLite3::InterruptException < ::SQLite3::Exception; end
769
+
770
+ # source://sqlite3//lib/sqlite3/errors.rb#14
771
+ class SQLite3::LockedException < ::SQLite3::Exception; end
772
+
773
+ # source://sqlite3//lib/sqlite3/errors.rb#15
774
+ class SQLite3::MemoryException < ::SQLite3::Exception; end
775
+
776
+ # source://sqlite3//lib/sqlite3/errors.rb#28
777
+ class SQLite3::MismatchException < ::SQLite3::Exception; end
778
+
779
+ # source://sqlite3//lib/sqlite3/errors.rb#29
780
+ class SQLite3::MisuseException < ::SQLite3::Exception; end
781
+
782
+ # source://sqlite3//lib/sqlite3/errors.rb#34
783
+ class SQLite3::NotADatabaseException < ::SQLite3::Exception; end
784
+
785
+ # source://sqlite3//lib/sqlite3/errors.rb#20
786
+ class SQLite3::NotFoundException < ::SQLite3::Exception; end
787
+
788
+ # source://sqlite3//lib/sqlite3/errors.rb#11
789
+ class SQLite3::PermissionException < ::SQLite3::Exception; end
790
+
791
+ # This module is intended for inclusion solely by the Database class. It
792
+ # defines convenience methods for the various pragmas supported by SQLite3.
793
+ #
794
+ # For a detailed description of these pragmas, see the SQLite3 documentation
795
+ # at http://sqlite.org/pragma.html.
796
+ #
797
+ # source://sqlite3//lib/sqlite3/pragmas.rb#10
798
+ module SQLite3::Pragmas
799
+ # source://sqlite3//lib/sqlite3/pragmas.rb#104
800
+ def application_id; end
801
+
802
+ # source://sqlite3//lib/sqlite3/pragmas.rb#108
803
+ def application_id=(integer); end
804
+
805
+ # source://sqlite3//lib/sqlite3/pragmas.rb#112
806
+ def auto_vacuum; end
807
+
808
+ # source://sqlite3//lib/sqlite3/pragmas.rb#116
809
+ def auto_vacuum=(mode); end
810
+
811
+ # source://sqlite3//lib/sqlite3/pragmas.rb#120
812
+ def automatic_index; end
813
+
814
+ # source://sqlite3//lib/sqlite3/pragmas.rb#124
815
+ def automatic_index=(mode); end
816
+
817
+ # source://sqlite3//lib/sqlite3/pragmas.rb#128
818
+ def busy_timeout; end
819
+
820
+ # source://sqlite3//lib/sqlite3/pragmas.rb#132
821
+ def busy_timeout=(milliseconds); end
822
+
823
+ # source://sqlite3//lib/sqlite3/pragmas.rb#136
824
+ def cache_size; end
825
+
826
+ # source://sqlite3//lib/sqlite3/pragmas.rb#140
827
+ def cache_size=(size); end
828
+
829
+ # source://sqlite3//lib/sqlite3/pragmas.rb#144
830
+ def cache_spill; end
831
+
832
+ # source://sqlite3//lib/sqlite3/pragmas.rb#148
833
+ def cache_spill=(mode); end
834
+
835
+ # source://sqlite3//lib/sqlite3/pragmas.rb#152
836
+ def case_sensitive_like=(mode); end
837
+
838
+ # source://sqlite3//lib/sqlite3/pragmas.rb#156
839
+ def cell_size_check; end
840
+
841
+ # source://sqlite3//lib/sqlite3/pragmas.rb#160
842
+ def cell_size_check=(mode); end
843
+
844
+ # source://sqlite3//lib/sqlite3/pragmas.rb#164
845
+ def checkpoint_fullfsync; end
846
+
847
+ # source://sqlite3//lib/sqlite3/pragmas.rb#168
848
+ def checkpoint_fullfsync=(mode); end
849
+
850
+ # :yields: row
851
+ #
852
+ # source://sqlite3//lib/sqlite3/pragmas.rb#172
853
+ def collation_list(&block); end
854
+
855
+ # :yields: row
856
+ #
857
+ # source://sqlite3//lib/sqlite3/pragmas.rb#176
858
+ def compile_options(&block); end
859
+
860
+ # source://sqlite3//lib/sqlite3/pragmas.rb#180
861
+ def count_changes; end
862
+
863
+ # source://sqlite3//lib/sqlite3/pragmas.rb#184
864
+ def count_changes=(mode); end
865
+
866
+ # source://sqlite3//lib/sqlite3/pragmas.rb#188
867
+ def data_version; end
868
+
869
+ # :yields: row
870
+ #
871
+ # source://sqlite3//lib/sqlite3/pragmas.rb#192
872
+ def database_list(&block); end
873
+
874
+ # source://sqlite3//lib/sqlite3/pragmas.rb#196
875
+ def default_cache_size; end
876
+
877
+ # source://sqlite3//lib/sqlite3/pragmas.rb#200
878
+ def default_cache_size=(size); end
879
+
880
+ # source://sqlite3//lib/sqlite3/pragmas.rb#204
881
+ def default_synchronous; end
882
+
883
+ # source://sqlite3//lib/sqlite3/pragmas.rb#208
884
+ def default_synchronous=(mode); end
885
+
886
+ # source://sqlite3//lib/sqlite3/pragmas.rb#212
887
+ def default_temp_store; end
888
+
889
+ # source://sqlite3//lib/sqlite3/pragmas.rb#216
890
+ def default_temp_store=(mode); end
891
+
892
+ # source://sqlite3//lib/sqlite3/pragmas.rb#220
893
+ def defer_foreign_keys; end
894
+
895
+ # source://sqlite3//lib/sqlite3/pragmas.rb#224
896
+ def defer_foreign_keys=(mode); end
897
+
898
+ # source://sqlite3//lib/sqlite3/pragmas.rb#228
899
+ def encoding; end
900
+
901
+ # source://sqlite3//lib/sqlite3/pragmas.rb#232
902
+ def encoding=(mode); end
903
+
904
+ # :yields: row
905
+ #
906
+ # source://sqlite3//lib/sqlite3/pragmas.rb#236
907
+ def foreign_key_check(*table, &block); end
908
+
909
+ # :yields: row
910
+ #
911
+ # source://sqlite3//lib/sqlite3/pragmas.rb#240
912
+ def foreign_key_list(table, &block); end
913
+
914
+ # source://sqlite3//lib/sqlite3/pragmas.rb#244
915
+ def foreign_keys; end
916
+
917
+ # source://sqlite3//lib/sqlite3/pragmas.rb#248
918
+ def foreign_keys=(mode); end
919
+
920
+ # source://sqlite3//lib/sqlite3/pragmas.rb#252
921
+ def freelist_count; end
922
+
923
+ # source://sqlite3//lib/sqlite3/pragmas.rb#256
924
+ def full_column_names; end
925
+
926
+ # source://sqlite3//lib/sqlite3/pragmas.rb#260
927
+ def full_column_names=(mode); end
928
+
929
+ # source://sqlite3//lib/sqlite3/pragmas.rb#264
930
+ def fullfsync; end
931
+
932
+ # source://sqlite3//lib/sqlite3/pragmas.rb#268
933
+ def fullfsync=(mode); end
934
+
935
+ # Returns +true+ or +false+ depending on the value of the named pragma.
936
+ #
937
+ # source://sqlite3//lib/sqlite3/pragmas.rb#13
938
+ def get_boolean_pragma(name); end
939
+
940
+ # Return the value of the given pragma.
941
+ #
942
+ # source://sqlite3//lib/sqlite3/pragmas.rb#55
943
+ def get_enum_pragma(name); end
944
+
945
+ # Returns the value of the given pragma as an integer.
946
+ #
947
+ # source://sqlite3//lib/sqlite3/pragmas.rb#72
948
+ def get_int_pragma(name); end
949
+
950
+ # Requests the given pragma (and parameters), and if the block is given,
951
+ # each row of the result set will be yielded to it. Otherwise, the results
952
+ # are returned as an array.
953
+ #
954
+ # source://sqlite3//lib/sqlite3/pragmas.rb#45
955
+ def get_query_pragma(name, *params, &block); end
956
+
957
+ # source://sqlite3//lib/sqlite3/pragmas.rb#272
958
+ def ignore_check_constraints=(mode); end
959
+
960
+ # :yields: row
961
+ #
962
+ # source://sqlite3//lib/sqlite3/pragmas.rb#276
963
+ def incremental_vacuum(pages, &block); end
964
+
965
+ # :yields: row
966
+ #
967
+ # source://sqlite3//lib/sqlite3/pragmas.rb#280
968
+ def index_info(index, &block); end
969
+
970
+ # :yields: row
971
+ #
972
+ # source://sqlite3//lib/sqlite3/pragmas.rb#284
973
+ def index_list(table, &block); end
974
+
975
+ # :yields: row
976
+ #
977
+ # source://sqlite3//lib/sqlite3/pragmas.rb#288
978
+ def index_xinfo(index, &block); end
979
+
980
+ # :yields: row
981
+ #
982
+ # source://sqlite3//lib/sqlite3/pragmas.rb#292
983
+ def integrity_check(*num_errors, &block); end
984
+
985
+ # source://sqlite3//lib/sqlite3/pragmas.rb#296
986
+ def journal_mode; end
987
+
988
+ # source://sqlite3//lib/sqlite3/pragmas.rb#300
989
+ def journal_mode=(mode); end
990
+
991
+ # source://sqlite3//lib/sqlite3/pragmas.rb#304
992
+ def journal_size_limit; end
993
+
994
+ # source://sqlite3//lib/sqlite3/pragmas.rb#308
995
+ def journal_size_limit=(size); end
996
+
997
+ # source://sqlite3//lib/sqlite3/pragmas.rb#312
998
+ def legacy_file_format; end
999
+
1000
+ # source://sqlite3//lib/sqlite3/pragmas.rb#316
1001
+ def legacy_file_format=(mode); end
1002
+
1003
+ # source://sqlite3//lib/sqlite3/pragmas.rb#320
1004
+ def locking_mode; end
1005
+
1006
+ # source://sqlite3//lib/sqlite3/pragmas.rb#324
1007
+ def locking_mode=(mode); end
1008
+
1009
+ # source://sqlite3//lib/sqlite3/pragmas.rb#328
1010
+ def max_page_count; end
1011
+
1012
+ # source://sqlite3//lib/sqlite3/pragmas.rb#332
1013
+ def max_page_count=(size); end
1014
+
1015
+ # source://sqlite3//lib/sqlite3/pragmas.rb#336
1016
+ def mmap_size; end
1017
+
1018
+ # source://sqlite3//lib/sqlite3/pragmas.rb#340
1019
+ def mmap_size=(size); end
1020
+
1021
+ # source://sqlite3//lib/sqlite3/pragmas.rb#344
1022
+ def page_count; end
1023
+
1024
+ # source://sqlite3//lib/sqlite3/pragmas.rb#348
1025
+ def page_size; end
1026
+
1027
+ # source://sqlite3//lib/sqlite3/pragmas.rb#352
1028
+ def page_size=(size); end
1029
+
1030
+ # source://sqlite3//lib/sqlite3/pragmas.rb#356
1031
+ def parser_trace=(mode); end
1032
+
1033
+ # source://sqlite3//lib/sqlite3/pragmas.rb#360
1034
+ def query_only; end
1035
+
1036
+ # source://sqlite3//lib/sqlite3/pragmas.rb#364
1037
+ def query_only=(mode); end
1038
+
1039
+ # :yields: row
1040
+ #
1041
+ # source://sqlite3//lib/sqlite3/pragmas.rb#368
1042
+ def quick_check(*num_errors, &block); end
1043
+
1044
+ # source://sqlite3//lib/sqlite3/pragmas.rb#372
1045
+ def read_uncommitted; end
1046
+
1047
+ # source://sqlite3//lib/sqlite3/pragmas.rb#376
1048
+ def read_uncommitted=(mode); end
1049
+
1050
+ # source://sqlite3//lib/sqlite3/pragmas.rb#380
1051
+ def recursive_triggers; end
1052
+
1053
+ # source://sqlite3//lib/sqlite3/pragmas.rb#384
1054
+ def recursive_triggers=(mode); end
1055
+
1056
+ # source://sqlite3//lib/sqlite3/pragmas.rb#388
1057
+ def reverse_unordered_selects; end
1058
+
1059
+ # source://sqlite3//lib/sqlite3/pragmas.rb#392
1060
+ def reverse_unordered_selects=(mode); end
1061
+
1062
+ # source://sqlite3//lib/sqlite3/pragmas.rb#396
1063
+ def schema_cookie; end
1064
+
1065
+ # source://sqlite3//lib/sqlite3/pragmas.rb#400
1066
+ def schema_cookie=(cookie); end
1067
+
1068
+ # source://sqlite3//lib/sqlite3/pragmas.rb#404
1069
+ def schema_version; end
1070
+
1071
+ # source://sqlite3//lib/sqlite3/pragmas.rb#408
1072
+ def schema_version=(version); end
1073
+
1074
+ # source://sqlite3//lib/sqlite3/pragmas.rb#412
1075
+ def secure_delete; end
1076
+
1077
+ # source://sqlite3//lib/sqlite3/pragmas.rb#416
1078
+ def secure_delete=(mode); end
1079
+
1080
+ # Sets the given pragma to the given boolean value. The value itself
1081
+ # may be +true+ or +false+, or any other commonly used string or
1082
+ # integer that represents truth.
1083
+ #
1084
+ # source://sqlite3//lib/sqlite3/pragmas.rb#20
1085
+ def set_boolean_pragma(name, mode); end
1086
+
1087
+ # Set the value of the given pragma to +mode+. The +mode+ parameter must
1088
+ # conform to one of the values in the given +enum+ array. Each entry in
1089
+ # the array is another array comprised of elements in the enumeration that
1090
+ # have duplicate values. See #synchronous, #default_synchronous,
1091
+ # #temp_store, and #default_temp_store for usage examples.
1092
+ #
1093
+ # @raise [Exception]
1094
+ #
1095
+ # source://sqlite3//lib/sqlite3/pragmas.rb#64
1096
+ def set_enum_pragma(name, mode, enums); end
1097
+
1098
+ # Set the value of the given pragma to the integer value of the +value+
1099
+ # parameter.
1100
+ #
1101
+ # source://sqlite3//lib/sqlite3/pragmas.rb#78
1102
+ def set_int_pragma(name, value); end
1103
+
1104
+ # source://sqlite3//lib/sqlite3/pragmas.rb#420
1105
+ def short_column_names; end
1106
+
1107
+ # source://sqlite3//lib/sqlite3/pragmas.rb#424
1108
+ def short_column_names=(mode); end
1109
+
1110
+ # source://sqlite3//lib/sqlite3/pragmas.rb#428
1111
+ def shrink_memory; end
1112
+
1113
+ # source://sqlite3//lib/sqlite3/pragmas.rb#432
1114
+ def soft_heap_limit; end
1115
+
1116
+ # source://sqlite3//lib/sqlite3/pragmas.rb#436
1117
+ def soft_heap_limit=(mode); end
1118
+
1119
+ # :yields: row
1120
+ #
1121
+ # source://sqlite3//lib/sqlite3/pragmas.rb#440
1122
+ def stats(&block); end
1123
+
1124
+ # source://sqlite3//lib/sqlite3/pragmas.rb#444
1125
+ def synchronous; end
1126
+
1127
+ # source://sqlite3//lib/sqlite3/pragmas.rb#448
1128
+ def synchronous=(mode); end
1129
+
1130
+ # Returns information about +table+. Yields each row of table information
1131
+ # if a block is provided.
1132
+ #
1133
+ # source://sqlite3//lib/sqlite3/pragmas.rb#527
1134
+ def table_info(table); end
1135
+
1136
+ # source://sqlite3//lib/sqlite3/pragmas.rb#452
1137
+ def temp_store; end
1138
+
1139
+ # source://sqlite3//lib/sqlite3/pragmas.rb#456
1140
+ def temp_store=(mode); end
1141
+
1142
+ # source://sqlite3//lib/sqlite3/pragmas.rb#460
1143
+ def threads; end
1144
+
1145
+ # source://sqlite3//lib/sqlite3/pragmas.rb#464
1146
+ def threads=(count); end
1147
+
1148
+ # source://sqlite3//lib/sqlite3/pragmas.rb#468
1149
+ def user_cookie; end
1150
+
1151
+ # source://sqlite3//lib/sqlite3/pragmas.rb#472
1152
+ def user_cookie=(cookie); end
1153
+
1154
+ # source://sqlite3//lib/sqlite3/pragmas.rb#476
1155
+ def user_version; end
1156
+
1157
+ # source://sqlite3//lib/sqlite3/pragmas.rb#480
1158
+ def user_version=(version); end
1159
+
1160
+ # source://sqlite3//lib/sqlite3/pragmas.rb#484
1161
+ def vdbe_addoptrace=(mode); end
1162
+
1163
+ # source://sqlite3//lib/sqlite3/pragmas.rb#488
1164
+ def vdbe_debug=(mode); end
1165
+
1166
+ # source://sqlite3//lib/sqlite3/pragmas.rb#492
1167
+ def vdbe_listing=(mode); end
1168
+
1169
+ # source://sqlite3//lib/sqlite3/pragmas.rb#496
1170
+ def vdbe_trace; end
1171
+
1172
+ # source://sqlite3//lib/sqlite3/pragmas.rb#500
1173
+ def vdbe_trace=(mode); end
1174
+
1175
+ # source://sqlite3//lib/sqlite3/pragmas.rb#504
1176
+ def wal_autocheckpoint; end
1177
+
1178
+ # source://sqlite3//lib/sqlite3/pragmas.rb#508
1179
+ def wal_autocheckpoint=(mode); end
1180
+
1181
+ # source://sqlite3//lib/sqlite3/pragmas.rb#512
1182
+ def wal_checkpoint; end
1183
+
1184
+ # source://sqlite3//lib/sqlite3/pragmas.rb#516
1185
+ def wal_checkpoint=(mode); end
1186
+
1187
+ # source://sqlite3//lib/sqlite3/pragmas.rb#520
1188
+ def writable_schema=(mode); end
1189
+
1190
+ private
1191
+
1192
+ # Since SQLite 3.3.8, the table_info pragma has returned the default
1193
+ # value of the row as a quoted SQL value. This method essentially
1194
+ # unquotes those values.
1195
+ #
1196
+ # source://sqlite3//lib/sqlite3/pragmas.rb#583
1197
+ def tweak_default(hash); end
1198
+
1199
+ # Compares two version strings
1200
+ #
1201
+ # source://sqlite3//lib/sqlite3/pragmas.rb#567
1202
+ def version_compare(v1, v2); end
1203
+ end
1204
+
1205
+ # The enumeration of valid auto vacuum modes.
1206
+ #
1207
+ # source://sqlite3//lib/sqlite3/pragmas.rb#89
1208
+ SQLite3::Pragmas::AUTO_VACUUM_MODES = T.let(T.unsafe(nil), Array)
1209
+
1210
+ # The list of valid encodings.
1211
+ #
1212
+ # source://sqlite3//lib/sqlite3/pragmas.rb#99
1213
+ SQLite3::Pragmas::ENCODINGS = T.let(T.unsafe(nil), Array)
1214
+
1215
+ # The list of valid journaling modes.
1216
+ #
1217
+ # source://sqlite3//lib/sqlite3/pragmas.rb#92
1218
+ SQLite3::Pragmas::JOURNAL_MODES = T.let(T.unsafe(nil), Array)
1219
+
1220
+ # The list of valid locking modes.
1221
+ #
1222
+ # source://sqlite3//lib/sqlite3/pragmas.rb#96
1223
+ SQLite3::Pragmas::LOCKING_MODES = T.let(T.unsafe(nil), Array)
1224
+
1225
+ # The enumeration of valid synchronous modes.
1226
+ #
1227
+ # source://sqlite3//lib/sqlite3/pragmas.rb#83
1228
+ SQLite3::Pragmas::SYNCHRONOUS_MODES = T.let(T.unsafe(nil), Array)
1229
+
1230
+ # The enumeration of valid temp store modes.
1231
+ #
1232
+ # source://sqlite3//lib/sqlite3/pragmas.rb#86
1233
+ SQLite3::Pragmas::TEMP_STORE_MODES = T.let(T.unsafe(nil), Array)
1234
+
1235
+ # The list of valid WAL checkpoints.
1236
+ #
1237
+ # source://sqlite3//lib/sqlite3/pragmas.rb#102
1238
+ SQLite3::Pragmas::WAL_CHECKPOINTS = T.let(T.unsafe(nil), Array)
1239
+
1240
+ # source://sqlite3//lib/sqlite3/errors.rb#23
1241
+ class SQLite3::ProtocolException < ::SQLite3::Exception; end
1242
+
1243
+ # source://sqlite3//lib/sqlite3/errors.rb#33
1244
+ class SQLite3::RangeException < ::SQLite3::Exception; end
1245
+
1246
+ # source://sqlite3//lib/sqlite3/errors.rb#16
1247
+ class SQLite3::ReadOnlyException < ::SQLite3::Exception; end
1248
+
1249
+ # The ResultSet object encapsulates the enumerability of a query's output.
1250
+ # It is a simple cursor over the data that the query returns. It will
1251
+ # very rarely (if ever) be instantiated directly. Instead, clients should
1252
+ # obtain a ResultSet instance via Statement#execute.
1253
+ #
1254
+ # source://sqlite3//lib/sqlite3/resultset.rb#10
1255
+ class SQLite3::ResultSet
1256
+ include ::Enumerable
1257
+
1258
+ # Create a new ResultSet attached to the given database, using the
1259
+ # given sql text.
1260
+ #
1261
+ # @return [ResultSet] a new instance of ResultSet
1262
+ #
1263
+ # source://sqlite3//lib/sqlite3/resultset.rb#72
1264
+ def initialize(db, stmt); end
1265
+
1266
+ # Closes the statement that spawned this result set.
1267
+ # <em>Use with caution!</em> Closing a result set will automatically
1268
+ # close any other result sets that were spawned from the same statement.
1269
+ #
1270
+ # source://sqlite3//lib/sqlite3/resultset.rb#149
1271
+ def close; end
1272
+
1273
+ # Queries whether the underlying statement has been closed or not.
1274
+ #
1275
+ # @return [Boolean]
1276
+ #
1277
+ # source://sqlite3//lib/sqlite3/resultset.rb#154
1278
+ def closed?; end
1279
+
1280
+ # Returns the names of the columns returned by this result set.
1281
+ #
1282
+ # source://sqlite3//lib/sqlite3/resultset.rb#164
1283
+ def columns; end
1284
+
1285
+ # Required by the Enumerable mixin. Provides an internal iterator over the
1286
+ # rows of the result set.
1287
+ #
1288
+ # source://sqlite3//lib/sqlite3/resultset.rb#132
1289
+ def each; end
1290
+
1291
+ # Provides an internal iterator over the rows of the result set where
1292
+ # each row is yielded as a hash.
1293
+ #
1294
+ # source://sqlite3//lib/sqlite3/resultset.rb#140
1295
+ def each_hash; end
1296
+
1297
+ # Query whether the cursor has reached the end of the result set or not.
1298
+ #
1299
+ # @return [Boolean]
1300
+ #
1301
+ # source://sqlite3//lib/sqlite3/resultset.rb#86
1302
+ def eof?; end
1303
+
1304
+ # Obtain the next row from the cursor. If there are no more rows to be
1305
+ # had, this will return +nil+. If type translation is active on the
1306
+ # corresponding database, the values in the row will be translated
1307
+ # according to their types.
1308
+ #
1309
+ # The returned value will be an array, unless Database#results_as_hash has
1310
+ # been set to +true+, in which case the returned value will be a hash.
1311
+ #
1312
+ # For arrays, the column names are accessible via the +fields+ property,
1313
+ # and the column types are accessible via the +types+ property.
1314
+ #
1315
+ # For hashes, the column names are the keys of the hash, and the column
1316
+ # types are accessible via the +types+ property.
1317
+ #
1318
+ # source://sqlite3//lib/sqlite3/resultset.rb#103
1319
+ def next; end
1320
+
1321
+ # Return the next row as a hash
1322
+ #
1323
+ # source://sqlite3//lib/sqlite3/resultset.rb#169
1324
+ def next_hash; end
1325
+
1326
+ # Reset the cursor, so that a result set which has reached end-of-file
1327
+ # can be rewound and reiterated.
1328
+ #
1329
+ # source://sqlite3//lib/sqlite3/resultset.rb#79
1330
+ def reset(*bind_params); end
1331
+
1332
+ # Returns the types of the columns returned by this result set.
1333
+ #
1334
+ # source://sqlite3//lib/sqlite3/resultset.rb#159
1335
+ def types; end
1336
+ end
1337
+
1338
+ # source://sqlite3//lib/sqlite3/resultset.rb#13
1339
+ class SQLite3::ResultSet::ArrayWithTypes < ::Array
1340
+ # Returns the value of attribute types.
1341
+ #
1342
+ # source://sqlite3//lib/sqlite3/resultset.rb#14
1343
+ def types; end
1344
+
1345
+ # Sets the attribute types
1346
+ #
1347
+ # @param value the value to set the attribute types to.
1348
+ #
1349
+ # source://sqlite3//lib/sqlite3/resultset.rb#14
1350
+ def types=(_arg0); end
1351
+ end
1352
+
1353
+ # source://sqlite3//lib/sqlite3/resultset.rb#17
1354
+ class SQLite3::ResultSet::ArrayWithTypesAndFields < ::Array
1355
+ # source://sqlite3//lib/sqlite3/resultset.rb#30
1356
+ def fields; end
1357
+
1358
+ # Sets the attribute fields
1359
+ #
1360
+ # @param value the value to set the attribute fields to.
1361
+ #
1362
+ # source://sqlite3//lib/sqlite3/resultset.rb#19
1363
+ def fields=(_arg0); end
1364
+
1365
+ # source://sqlite3//lib/sqlite3/resultset.rb#21
1366
+ def types; end
1367
+
1368
+ # Sets the attribute types
1369
+ #
1370
+ # @param value the value to set the attribute types to.
1371
+ #
1372
+ # source://sqlite3//lib/sqlite3/resultset.rb#18
1373
+ def types=(_arg0); end
1374
+ end
1375
+
1376
+ # The class of which we return an object in case we want a Hash as
1377
+ # result.
1378
+ #
1379
+ # source://sqlite3//lib/sqlite3/resultset.rb#42
1380
+ class SQLite3::ResultSet::HashWithTypesAndFields < ::Hash
1381
+ # source://sqlite3//lib/sqlite3/resultset.rb#64
1382
+ def [](key); end
1383
+
1384
+ # source://sqlite3//lib/sqlite3/resultset.rb#55
1385
+ def fields; end
1386
+
1387
+ # Sets the attribute fields
1388
+ #
1389
+ # @param value the value to set the attribute fields to.
1390
+ #
1391
+ # source://sqlite3//lib/sqlite3/resultset.rb#44
1392
+ def fields=(_arg0); end
1393
+
1394
+ # source://sqlite3//lib/sqlite3/resultset.rb#46
1395
+ def types; end
1396
+
1397
+ # source://sqlite3//lib/sqlite3/resultset.rb#43
1398
+ def types=(_arg0); end
1399
+ end
1400
+
1401
+ # source://sqlite3//lib/sqlite3/errors.rb#9
1402
+ class SQLite3::SQLException < ::SQLite3::Exception; end
1403
+
1404
+ SQLite3::SQLITE_LOADED_VERSION = T.let(T.unsafe(nil), String)
1405
+ SQLite3::SQLITE_VERSION = T.let(T.unsafe(nil), String)
1406
+ SQLite3::SQLITE_VERSION_NUMBER = T.let(T.unsafe(nil), Integer)
1407
+
1408
+ # source://sqlite3//lib/sqlite3/errors.rb#25
1409
+ class SQLite3::SchemaChangedException < ::SQLite3::Exception; end
1410
+
1411
+ # A statement represents a prepared-but-unexecuted SQL query. It will rarely
1412
+ # (if ever) be instantiated directly by a client, and is most often obtained
1413
+ # via the Database#prepare method.
1414
+ #
1415
+ # source://sqlite3//lib/sqlite3/statement.rb#14
1416
+ class SQLite3::Statement
1417
+ include ::Enumerable
1418
+
1419
+ def initialize(_arg0, _arg1); end
1420
+
1421
+ # Returns true if the statement is currently active, meaning it has an
1422
+ # open result set.
1423
+ #
1424
+ # @return [Boolean]
1425
+ #
1426
+ # source://sqlite3//lib/sqlite3/statement.rb#94
1427
+ def active?; end
1428
+
1429
+ def bind_param(_arg0, _arg1); end
1430
+ def bind_parameter_count; end
1431
+
1432
+ # Binds the given variables to the corresponding placeholders in the SQL
1433
+ # text.
1434
+ #
1435
+ # See Database#execute for a description of the valid placeholder
1436
+ # syntaxes.
1437
+ #
1438
+ # Example:
1439
+ #
1440
+ # stmt = db.prepare( "select * from table where a=? and b=?" )
1441
+ # stmt.bind_params( 15, "hello" )
1442
+ #
1443
+ # See also #execute, #bind_param, Statement#bind_param, and
1444
+ # Statement#bind_params.
1445
+ #
1446
+ # source://sqlite3//lib/sqlite3/statement.rb#35
1447
+ def bind_params(*bind_vars); end
1448
+
1449
+ def clear_bindings!; end
1450
+ def close; end
1451
+ def closed?; end
1452
+ def column_count; end
1453
+ def column_decltype(_arg0); end
1454
+ def column_name(_arg0); end
1455
+
1456
+ # Return an array of the column names for this statement. Note that this
1457
+ # may execute the statement in order to obtain the metadata; this makes it
1458
+ # a (potentially) expensive operation.
1459
+ #
1460
+ # source://sqlite3//lib/sqlite3/statement.rb#101
1461
+ def columns; end
1462
+
1463
+ def done?; end
1464
+
1465
+ # source://sqlite3//lib/sqlite3/statement.rb#106
1466
+ def each; end
1467
+
1468
+ # Execute the statement. This creates a new ResultSet object for the
1469
+ # statement's virtual machine. If a block was given, the new ResultSet will
1470
+ # be yielded to it; otherwise, the ResultSet will be returned.
1471
+ #
1472
+ # Any parameters will be bound to the statement using #bind_params.
1473
+ #
1474
+ # Example:
1475
+ #
1476
+ # stmt = db.prepare( "select * from table" )
1477
+ # stmt.execute do |result|
1478
+ # ...
1479
+ # end
1480
+ #
1481
+ # See also #bind_params, #execute!.
1482
+ #
1483
+ # @yield [@results]
1484
+ #
1485
+ # source://sqlite3//lib/sqlite3/statement.rb#61
1486
+ def execute(*bind_vars); end
1487
+
1488
+ # Execute the statement. If no block was given, this returns an array of
1489
+ # rows returned by executing the statement. Otherwise, each row will be
1490
+ # yielded to the block.
1491
+ #
1492
+ # Any parameters will be bound to the statement using #bind_params.
1493
+ #
1494
+ # Example:
1495
+ #
1496
+ # stmt = db.prepare( "select * from table" )
1497
+ # stmt.execute! do |row|
1498
+ # ...
1499
+ # end
1500
+ #
1501
+ # See also #bind_params, #execute.
1502
+ #
1503
+ # source://sqlite3//lib/sqlite3/statement.rb#87
1504
+ def execute!(*bind_vars, &block); end
1505
+
1506
+ # Performs a sanity check to ensure that the statement is not
1507
+ # closed. If it is, an exception is raised.
1508
+ #
1509
+ # source://sqlite3//lib/sqlite3/statement.rb#125
1510
+ def must_be_open!; end
1511
+
1512
+ # This is any text that followed the first valid SQL statement in the text
1513
+ # with which the statement was initialized. If there was no trailing text,
1514
+ # this will be the empty string.
1515
+ #
1516
+ # source://sqlite3//lib/sqlite3/statement.rb#20
1517
+ def remainder; end
1518
+
1519
+ def reset!; end
1520
+ def step; end
1521
+
1522
+ # Return an array of the data types for each column in this statement. Note
1523
+ # that this may execute the statement in order to obtain the metadata; this
1524
+ # makes it a (potentially) expensive operation.
1525
+ #
1526
+ # source://sqlite3//lib/sqlite3/statement.rb#117
1527
+ def types; end
1528
+
1529
+ private
1530
+
1531
+ # A convenience method for obtaining the metadata about the query. Note
1532
+ # that this will actually execute the SQL, which means it can be a
1533
+ # (potentially) expensive operation.
1534
+ #
1535
+ # source://sqlite3//lib/sqlite3/statement.rb#135
1536
+ def get_metadata; end
1537
+ end
1538
+
1539
+ # source://sqlite3//lib/sqlite3/errors.rb#26
1540
+ class SQLite3::TooBigException < ::SQLite3::Exception; end
1541
+
1542
+ # The Translator class encapsulates the logic and callbacks necessary for
1543
+ # converting string data to a value of some specified type. Every Database
1544
+ # instance may have a Translator instance, in order to assist in type
1545
+ # translation (Database#type_translation).
1546
+ #
1547
+ # Further, applications may define their own custom type translation logic
1548
+ # by registering translator blocks with the corresponding database's
1549
+ # translator instance (Database#translator).
1550
+ #
1551
+ # source://sqlite3//lib/sqlite3/translator.rb#14
1552
+ class SQLite3::Translator
1553
+ # Create a new Translator instance. It will be preinitialized with default
1554
+ # translators for most SQL data types.
1555
+ #
1556
+ # @return [Translator] a new instance of Translator
1557
+ #
1558
+ # source://sqlite3//lib/sqlite3/translator.rb#18
1559
+ def initialize; end
1560
+
1561
+ # Add a new translator block, which will be invoked to process type
1562
+ # translations to the given type. The type should be an SQL datatype, and
1563
+ # may include parentheses (i.e., "VARCHAR(30)"). However, any parenthetical
1564
+ # information is stripped off and discarded, so type translation decisions
1565
+ # are made solely on the "base" type name.
1566
+ #
1567
+ # The translator block itself should accept two parameters, "type" and
1568
+ # "value". In this case, the "type" is the full type name (including
1569
+ # parentheses), so the block itself may include logic for changing how a
1570
+ # type is translated based on the additional data. The "value" parameter
1571
+ # is the (string) data to convert.
1572
+ #
1573
+ # The block should return the translated value.
1574
+ #
1575
+ # source://sqlite3//lib/sqlite3/translator.rb#37
1576
+ def add_translator(type, &block); end
1577
+
1578
+ # Translate the given string value to a value of the given type. In the
1579
+ # absence of an installed translator block for the given type, the value
1580
+ # itself is always returned. Further, +nil+ values are never translated,
1581
+ # and are always passed straight through regardless of the type parameter.
1582
+ #
1583
+ # source://sqlite3//lib/sqlite3/translator.rb#49
1584
+ def translate(type, value); end
1585
+
1586
+ private
1587
+
1588
+ # Register the default translators for the current Translator instance.
1589
+ # This includes translators for most major SQL data types.
1590
+ #
1591
+ # source://sqlite3//lib/sqlite3/translator.rb#73
1592
+ def register_default_translators; end
1593
+
1594
+ # A convenience method for working with type names. This returns the "base"
1595
+ # type name, without any parenthetical data.
1596
+ #
1597
+ # source://sqlite3//lib/sqlite3/translator.rb#62
1598
+ def type_name(type); end
1599
+ end
1600
+
1601
+ # source://sqlite3//lib/sqlite3/errors.rb#30
1602
+ class SQLite3::UnsupportedException < ::SQLite3::Exception; end
1603
+
1604
+ # source://sqlite3//lib/sqlite3/version.rb#3
1605
+ SQLite3::VERSION = T.let(T.unsafe(nil), String)
1606
+
1607
+ # source://sqlite3//lib/sqlite3/value.rb#5
1608
+ class SQLite3::Value
1609
+ # @return [Value] a new instance of Value
1610
+ #
1611
+ # source://sqlite3//lib/sqlite3/value.rb#8
1612
+ def initialize(db, handle); end
1613
+
1614
+ # Returns the value of attribute handle.
1615
+ #
1616
+ # source://sqlite3//lib/sqlite3/value.rb#6
1617
+ def handle; end
1618
+
1619
+ # source://sqlite3//lib/sqlite3/value.rb#21
1620
+ def length(utf16 = T.unsafe(nil)); end
1621
+
1622
+ # @return [Boolean]
1623
+ #
1624
+ # source://sqlite3//lib/sqlite3/value.rb#13
1625
+ def null?; end
1626
+
1627
+ # source://sqlite3//lib/sqlite3/value.rb#17
1628
+ def to_blob; end
1629
+
1630
+ # source://sqlite3//lib/sqlite3/value.rb#29
1631
+ def to_f; end
1632
+
1633
+ # source://sqlite3//lib/sqlite3/value.rb#33
1634
+ def to_i; end
1635
+
1636
+ # source://sqlite3//lib/sqlite3/value.rb#37
1637
+ def to_int64; end
1638
+
1639
+ # source://sqlite3//lib/sqlite3/value.rb#41
1640
+ def to_s(utf16 = T.unsafe(nil)); end
1641
+
1642
+ # source://sqlite3//lib/sqlite3/value.rb#45
1643
+ def type; end
1644
+ end
1645
+
1646
+ # source://sqlite3//lib/sqlite3/version.rb#5
1647
+ module SQLite3::VersionProxy; end
1648
+
1649
+ # source://sqlite3//lib/sqlite3/version.rb#9
1650
+ SQLite3::VersionProxy::BUILD = T.let(T.unsafe(nil), T.untyped)
1651
+
1652
+ # source://sqlite3//lib/sqlite3/version.rb#6
1653
+ SQLite3::VersionProxy::MAJOR = T.let(T.unsafe(nil), Integer)
1654
+
1655
+ # source://sqlite3//lib/sqlite3/version.rb#7
1656
+ SQLite3::VersionProxy::MINOR = T.let(T.unsafe(nil), Integer)
1657
+
1658
+ # source://sqlite3//lib/sqlite3/version.rb#11
1659
+ SQLite3::VersionProxy::STRING = T.let(T.unsafe(nil), String)
1660
+
1661
+ # source://sqlite3//lib/sqlite3/version.rb#8
1662
+ SQLite3::VersionProxy::TINY = T.let(T.unsafe(nil), Integer)
1663
+
1664
+ # source://sqlite3//lib/sqlite3/version.rb#13
1665
+ SQLite3::VersionProxy::VERSION = T.let(T.unsafe(nil), String)
1666
+
1667
+ # source://sqlite3//lib/sqlite3/statement.rb#4
1668
+ class String
1669
+ include ::Comparable
1670
+
1671
+ # source://sqlite3//lib/sqlite3/statement.rb#5
1672
+ def to_blob; end
1673
+ end