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