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