sqlite3-full 1.3.9.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +7 -0
  2. data/.gemtest +0 -0
  3. data/API_CHANGES.rdoc +50 -0
  4. data/CHANGELOG.rdoc +278 -0
  5. data/ChangeLog.cvs +88 -0
  6. data/Gemfile +15 -0
  7. data/LICENSE +34 -0
  8. data/Manifest.txt +52 -0
  9. data/README.rdoc +90 -0
  10. data/Rakefile +10 -0
  11. data/ext/sqlite3/backup.c +168 -0
  12. data/ext/sqlite3/backup.h +15 -0
  13. data/ext/sqlite3/database.c +825 -0
  14. data/ext/sqlite3/database.h +15 -0
  15. data/ext/sqlite3/exception.c +94 -0
  16. data/ext/sqlite3/exception.h +8 -0
  17. data/ext/sqlite3/extconf.rb +86 -0
  18. data/ext/sqlite3/sqlite3.c +97 -0
  19. data/ext/sqlite3/sqlite3_ruby.h +52 -0
  20. data/ext/sqlite3/sqlite3amalgamation.c +153367 -0
  21. data/ext/sqlite3/statement.c +447 -0
  22. data/ext/sqlite3/statement.h +16 -0
  23. data/faq/faq.rb +145 -0
  24. data/faq/faq.yml +426 -0
  25. data/lib/sqlite3/constants.rb +49 -0
  26. data/lib/sqlite3/database.rb +590 -0
  27. data/lib/sqlite3/errors.rb +44 -0
  28. data/lib/sqlite3/pragmas.rb +280 -0
  29. data/lib/sqlite3/resultset.rb +195 -0
  30. data/lib/sqlite3/statement.rb +144 -0
  31. data/lib/sqlite3/translator.rb +118 -0
  32. data/lib/sqlite3/value.rb +57 -0
  33. data/lib/sqlite3/version.rb +25 -0
  34. data/lib/sqlite3.rb +10 -0
  35. data/setup.rb +1333 -0
  36. data/tasks/faq.rake +9 -0
  37. data/tasks/gem.rake +38 -0
  38. data/tasks/native.rake +52 -0
  39. data/tasks/vendor_sqlite3.rake +91 -0
  40. data/test/helper.rb +18 -0
  41. data/test/test_backup.rb +33 -0
  42. data/test/test_collation.rb +82 -0
  43. data/test/test_database.rb +367 -0
  44. data/test/test_database_readonly.rb +29 -0
  45. data/test/test_deprecated.rb +44 -0
  46. data/test/test_encoding.rb +153 -0
  47. data/test/test_integration.rb +572 -0
  48. data/test/test_integration_open_close.rb +30 -0
  49. data/test/test_integration_pending.rb +115 -0
  50. data/test/test_integration_resultset.rb +159 -0
  51. data/test/test_integration_statement.rb +194 -0
  52. data/test/test_result_set.rb +37 -0
  53. data/test/test_sqlite3.rb +9 -0
  54. data/test/test_statement.rb +260 -0
  55. data/test/test_statement_execute.rb +35 -0
  56. metadata +205 -0
@@ -0,0 +1,590 @@
1
+ require 'sqlite3/constants'
2
+ require 'sqlite3/errors'
3
+ require 'sqlite3/pragmas'
4
+ require 'sqlite3/statement'
5
+ require 'sqlite3/translator'
6
+ require 'sqlite3/value'
7
+
8
+ module SQLite3
9
+
10
+ # The Database class encapsulates a single connection to a SQLite3 database.
11
+ # Its usage is very straightforward:
12
+ #
13
+ # require 'sqlite3'
14
+ #
15
+ # SQLite3::Database.new( "data.db" ) do |db|
16
+ # db.execute( "select * from table" ) do |row|
17
+ # p row
18
+ # end
19
+ # end
20
+ #
21
+ # It wraps the lower-level methods provides by the selected driver, and
22
+ # includes the Pragmas module for access to various pragma convenience
23
+ # methods.
24
+ #
25
+ # The Database class provides type translation services as well, by which
26
+ # the SQLite3 data types (which are all represented as strings) may be
27
+ # converted into their corresponding types (as defined in the schemas
28
+ # for their tables). This translation only occurs when querying data from
29
+ # the database--insertions and updates are all still typeless.
30
+ #
31
+ # Furthermore, the Database class has been designed to work well with the
32
+ # ArrayFields module from Ara Howard. If you require the ArrayFields
33
+ # module before performing a query, and if you have not enabled results as
34
+ # hashes, then the results will all be indexible by field name.
35
+ class Database
36
+ attr_reader :collations
37
+
38
+ include Pragmas
39
+
40
+ class << self
41
+
42
+ alias :open :new
43
+
44
+ # Quotes the given string, making it safe to use in an SQL statement.
45
+ # It replaces all instances of the single-quote character with two
46
+ # single-quote characters. The modified string is returned.
47
+ def quote( string )
48
+ string.gsub( /'/, "''" )
49
+ end
50
+
51
+ end
52
+
53
+ # A boolean that indicates whether rows in result sets should be returned
54
+ # as hashes or not. By default, rows are returned as arrays.
55
+ attr_accessor :results_as_hash
56
+
57
+ def type_translation= value # :nodoc:
58
+ warn(<<-eowarn) if $VERBOSE
59
+ #{caller[0]} is calling SQLite3::Database#type_translation=
60
+ SQLite3::Database#type_translation= is deprecated and will be removed
61
+ in version 2.0.0.
62
+ eowarn
63
+ @type_translation = value
64
+ end
65
+ attr_reader :type_translation # :nodoc:
66
+
67
+ # Return the type translator employed by this database instance. Each
68
+ # database instance has its own type translator; this allows for different
69
+ # type handlers to be installed in each instance without affecting other
70
+ # instances. Furthermore, the translators are instantiated lazily, so that
71
+ # if a database does not use type translation, it will not be burdened by
72
+ # the overhead of a useless type translator. (See the Translator class.)
73
+ def translator
74
+ @translator ||= Translator.new
75
+ end
76
+
77
+ # Installs (or removes) a block that will be invoked for every access
78
+ # to the database. If the block returns 0 (or +nil+), the statement
79
+ # is allowed to proceed. Returning 1 causes an authorization error to
80
+ # occur, and returning 2 causes the access to be silently denied.
81
+ def authorizer( &block )
82
+ self.authorizer = block
83
+ end
84
+
85
+ # Returns a Statement object representing the given SQL. This does not
86
+ # execute the statement; it merely prepares the statement for execution.
87
+ #
88
+ # The Statement can then be executed using Statement#execute.
89
+ #
90
+ def prepare sql
91
+ stmt = SQLite3::Statement.new( self, sql )
92
+ return stmt unless block_given?
93
+
94
+ begin
95
+ yield stmt
96
+ ensure
97
+ stmt.close unless stmt.closed?
98
+ end
99
+ end
100
+
101
+ # Executes the given SQL statement. If additional parameters are given,
102
+ # they are treated as bind variables, and are bound to the placeholders in
103
+ # the query.
104
+ #
105
+ # Note that if any of the values passed to this are hashes, then the
106
+ # key/value pairs are each bound separately, with the key being used as
107
+ # the name of the placeholder to bind the value to.
108
+ #
109
+ # The block is optional. If given, it will be invoked for each row returned
110
+ # by the query. Otherwise, any results are accumulated into an array and
111
+ # returned wholesale.
112
+ #
113
+ # See also #execute2, #query, and #execute_batch for additional ways of
114
+ # executing statements.
115
+ def execute sql, bind_vars = [], *args, &block
116
+ # FIXME: This is a terrible hack and should be removed but is required
117
+ # for older versions of rails
118
+ hack = Object.const_defined?(:ActiveRecord) && sql =~ /^PRAGMA index_list/
119
+
120
+ if bind_vars.nil? || !args.empty?
121
+ if args.empty?
122
+ bind_vars = []
123
+ else
124
+ bind_vars = [bind_vars] + args
125
+ end
126
+
127
+ warn(<<-eowarn) if $VERBOSE
128
+ #{caller[0]} is calling SQLite3::Database#execute with nil or multiple bind params
129
+ without using an array. Please switch to passing bind parameters as an array.
130
+ Support for bind parameters as *args will be removed in 2.0.0.
131
+ eowarn
132
+ end
133
+
134
+ prepare( sql ) do |stmt|
135
+ stmt.bind_params(bind_vars)
136
+ columns = stmt.columns
137
+ stmt = ResultSet.new(self, stmt).to_a if type_translation
138
+
139
+ if block_given?
140
+ stmt.each do |row|
141
+ if @results_as_hash
142
+ yield type_translation ? row : ordered_map_for(columns, row)
143
+ else
144
+ yield row
145
+ end
146
+ end
147
+ else
148
+ if @results_as_hash
149
+ stmt.map { |row|
150
+ h = type_translation ? row : ordered_map_for(columns, row)
151
+
152
+ # FIXME UGH TERRIBLE HACK!
153
+ h['unique'] = h['unique'].to_s if hack
154
+
155
+ h
156
+ }
157
+ else
158
+ stmt.to_a
159
+ end
160
+ end
161
+ end
162
+ end
163
+
164
+ # Executes the given SQL statement, exactly as with #execute. However, the
165
+ # first row returned (either via the block, or in the returned array) is
166
+ # always the names of the columns. Subsequent rows correspond to the data
167
+ # from the result set.
168
+ #
169
+ # Thus, even if the query itself returns no rows, this method will always
170
+ # return at least one row--the names of the columns.
171
+ #
172
+ # See also #execute, #query, and #execute_batch for additional ways of
173
+ # executing statements.
174
+ def execute2( sql, *bind_vars )
175
+ prepare( sql ) do |stmt|
176
+ result = stmt.execute( *bind_vars )
177
+ if block_given?
178
+ yield stmt.columns
179
+ result.each { |row| yield row }
180
+ else
181
+ return result.inject( [ stmt.columns ] ) { |arr,row|
182
+ arr << row; arr }
183
+ end
184
+ end
185
+ end
186
+
187
+ # Executes all SQL statements in the given string. By contrast, the other
188
+ # means of executing queries will only execute the first statement in the
189
+ # string, ignoring all subsequent statements. This will execute each one
190
+ # in turn. The same bind parameters, if given, will be applied to each
191
+ # statement.
192
+ #
193
+ # This always returns +nil+, making it unsuitable for queries that return
194
+ # rows.
195
+ def execute_batch( sql, bind_vars = [], *args )
196
+ # FIXME: remove this stuff later
197
+ unless [Array, Hash].include?(bind_vars.class)
198
+ bind_vars = [bind_vars]
199
+ warn(<<-eowarn) if $VERBOSE
200
+ #{caller[0]} is calling SQLite3::Database#execute_batch with bind parameters
201
+ that are not a list of a hash. Please switch to passing bind parameters as an
202
+ array or hash. Support for this behavior will be removed in version 2.0.0.
203
+ eowarn
204
+ end
205
+
206
+ # FIXME: remove this stuff later
207
+ if bind_vars.nil? || !args.empty?
208
+ if args.empty?
209
+ bind_vars = []
210
+ else
211
+ bind_vars = [nil] + args
212
+ end
213
+
214
+ warn(<<-eowarn) if $VERBOSE
215
+ #{caller[0]} is calling SQLite3::Database#execute_batch with nil or multiple bind params
216
+ without using an array. Please switch to passing bind parameters as an array.
217
+ Support for this behavior will be removed in version 2.0.0.
218
+ eowarn
219
+ end
220
+
221
+ sql = sql.strip
222
+ until sql.empty? do
223
+ prepare( sql ) do |stmt|
224
+ unless stmt.closed?
225
+ # FIXME: this should probably use sqlite3's api for batch execution
226
+ # This implementation requires stepping over the results.
227
+ if bind_vars.length == stmt.bind_parameter_count
228
+ stmt.bind_params(bind_vars)
229
+ end
230
+ stmt.step
231
+ end
232
+ sql = stmt.remainder.strip
233
+ end
234
+ end
235
+ # FIXME: we should not return `nil` as a success return value
236
+ nil
237
+ end
238
+
239
+ # This is a convenience method for creating a statement, binding
240
+ # paramters to it, and calling execute:
241
+ #
242
+ # result = db.query( "select * from foo where a=?", [5])
243
+ # # is the same as
244
+ # result = db.prepare( "select * from foo where a=?" ).execute( 5 )
245
+ #
246
+ # You must be sure to call +close+ on the ResultSet instance that is
247
+ # returned, or you could have problems with locks on the table. If called
248
+ # with a block, +close+ will be invoked implicitly when the block
249
+ # terminates.
250
+ def query( sql, bind_vars = [], *args )
251
+
252
+ if bind_vars.nil? || !args.empty?
253
+ if args.empty?
254
+ bind_vars = []
255
+ else
256
+ bind_vars = [bind_vars] + args
257
+ end
258
+
259
+ warn(<<-eowarn) if $VERBOSE
260
+ #{caller[0]} is calling SQLite3::Database#query with nil or multiple bind params
261
+ without using an array. Please switch to passing bind parameters as an array.
262
+ Support for this will be removed in version 2.0.0.
263
+ eowarn
264
+ end
265
+
266
+ result = prepare( sql ).execute( bind_vars )
267
+ if block_given?
268
+ begin
269
+ yield result
270
+ ensure
271
+ result.close
272
+ end
273
+ else
274
+ return result
275
+ end
276
+ end
277
+
278
+ # A convenience method for obtaining the first row of a result set, and
279
+ # discarding all others. It is otherwise identical to #execute.
280
+ #
281
+ # See also #get_first_value.
282
+ def get_first_row( sql, *bind_vars )
283
+ execute( sql, *bind_vars ).first
284
+ end
285
+
286
+ # A convenience method for obtaining the first value of the first row of a
287
+ # result set, and discarding all other values and rows. It is otherwise
288
+ # identical to #execute.
289
+ #
290
+ # See also #get_first_row.
291
+ def get_first_value( sql, *bind_vars )
292
+ execute( sql, *bind_vars ) { |row| return row[0] }
293
+ nil
294
+ end
295
+
296
+ alias :busy_timeout :busy_timeout=
297
+
298
+ # Creates a new function for use in SQL statements. It will be added as
299
+ # +name+, with the given +arity+. (For variable arity functions, use
300
+ # -1 for the arity.)
301
+ #
302
+ # The block should accept at least one parameter--the FunctionProxy
303
+ # instance that wraps this function invocation--and any other
304
+ # arguments it needs (up to its arity).
305
+ #
306
+ # The block does not return a value directly. Instead, it will invoke
307
+ # the FunctionProxy#result= method on the +func+ parameter and
308
+ # indicate the return value that way.
309
+ #
310
+ # Example:
311
+ #
312
+ # db.create_function( "maim", 1 ) do |func, value|
313
+ # if value.nil?
314
+ # func.result = nil
315
+ # else
316
+ # func.result = value.split(//).sort.join
317
+ # end
318
+ # end
319
+ #
320
+ # puts db.get_first_value( "select maim(name) from table" )
321
+ def create_function name, arity, text_rep=Constants::TextRep::ANY, &block
322
+ define_function(name) do |*args|
323
+ fp = FunctionProxy.new
324
+ block.call(fp, *args)
325
+ fp.result
326
+ end
327
+ self
328
+ end
329
+
330
+ # Creates a new aggregate function for use in SQL statements. Aggregate
331
+ # functions are functions that apply over every row in the result set,
332
+ # instead of over just a single row. (A very common aggregate function
333
+ # is the "count" function, for determining the number of rows that match
334
+ # a query.)
335
+ #
336
+ # The new function will be added as +name+, with the given +arity+. (For
337
+ # variable arity functions, use -1 for the arity.)
338
+ #
339
+ # The +step+ parameter must be a proc object that accepts as its first
340
+ # parameter a FunctionProxy instance (representing the function
341
+ # invocation), with any subsequent parameters (up to the function's arity).
342
+ # The +step+ callback will be invoked once for each row of the result set.
343
+ #
344
+ # The +finalize+ parameter must be a +proc+ object that accepts only a
345
+ # single parameter, the FunctionProxy instance representing the current
346
+ # function invocation. It should invoke FunctionProxy#result= to
347
+ # store the result of the function.
348
+ #
349
+ # Example:
350
+ #
351
+ # db.create_aggregate( "lengths", 1 ) do
352
+ # step do |func, value|
353
+ # func[ :total ] ||= 0
354
+ # func[ :total ] += ( value ? value.length : 0 )
355
+ # end
356
+ #
357
+ # finalize do |func|
358
+ # func.result = func[ :total ] || 0
359
+ # end
360
+ # end
361
+ #
362
+ # puts db.get_first_value( "select lengths(name) from table" )
363
+ #
364
+ # See also #create_aggregate_handler for a more object-oriented approach to
365
+ # aggregate functions.
366
+ def create_aggregate( name, arity, step=nil, finalize=nil,
367
+ text_rep=Constants::TextRep::ANY, &block )
368
+
369
+ factory = Class.new do
370
+ def self.step( &block )
371
+ define_method(:step, &block)
372
+ end
373
+
374
+ def self.finalize( &block )
375
+ define_method(:finalize, &block)
376
+ end
377
+ end
378
+
379
+ if block_given?
380
+ factory.instance_eval(&block)
381
+ else
382
+ factory.class_eval do
383
+ define_method(:step, step)
384
+ define_method(:finalize, finalize)
385
+ end
386
+ end
387
+
388
+ proxy = factory.new
389
+ proxy.extend(Module.new {
390
+ attr_accessor :ctx
391
+
392
+ def step( *args )
393
+ super(@ctx, *args)
394
+ end
395
+
396
+ def finalize
397
+ super(@ctx)
398
+ end
399
+ })
400
+ proxy.ctx = FunctionProxy.new
401
+ define_aggregator(name, proxy)
402
+ end
403
+
404
+ # This is another approach to creating an aggregate function (see
405
+ # #create_aggregate). Instead of explicitly specifying the name,
406
+ # callbacks, arity, and type, you specify a factory object
407
+ # (the "handler") that knows how to obtain all of that information. The
408
+ # handler should respond to the following messages:
409
+ #
410
+ # +arity+:: corresponds to the +arity+ parameter of #create_aggregate. This
411
+ # message is optional, and if the handler does not respond to it,
412
+ # the function will have an arity of -1.
413
+ # +name+:: this is the name of the function. The handler _must_ implement
414
+ # this message.
415
+ # +new+:: this must be implemented by the handler. It should return a new
416
+ # instance of the object that will handle a specific invocation of
417
+ # the function.
418
+ #
419
+ # The handler instance (the object returned by the +new+ message, described
420
+ # above), must respond to the following messages:
421
+ #
422
+ # +step+:: this is the method that will be called for each step of the
423
+ # aggregate function's evaluation. It should implement the same
424
+ # signature as the +step+ callback for #create_aggregate.
425
+ # +finalize+:: this is the method that will be called to finalize the
426
+ # aggregate function's evaluation. It should implement the
427
+ # same signature as the +finalize+ callback for
428
+ # #create_aggregate.
429
+ #
430
+ # Example:
431
+ #
432
+ # class LengthsAggregateHandler
433
+ # def self.arity; 1; end
434
+ # def self.name; 'lengths'; end
435
+ #
436
+ # def initialize
437
+ # @total = 0
438
+ # end
439
+ #
440
+ # def step( ctx, name )
441
+ # @total += ( name ? name.length : 0 )
442
+ # end
443
+ #
444
+ # def finalize( ctx )
445
+ # ctx.result = @total
446
+ # end
447
+ # end
448
+ #
449
+ # db.create_aggregate_handler( LengthsAggregateHandler )
450
+ # puts db.get_first_value( "select lengths(name) from A" )
451
+ def create_aggregate_handler( handler )
452
+ proxy = Class.new do
453
+ def initialize klass
454
+ @klass = klass
455
+ @fp = FunctionProxy.new
456
+ end
457
+
458
+ def step( *args )
459
+ instance.step(@fp, *args)
460
+ end
461
+
462
+ def finalize
463
+ instance.finalize @fp
464
+ @instance = nil
465
+ @fp.result
466
+ end
467
+
468
+ private
469
+
470
+ def instance
471
+ @instance ||= @klass.new
472
+ end
473
+ end
474
+ define_aggregator(handler.name, proxy.new(handler))
475
+ self
476
+ end
477
+
478
+ # Begins a new transaction. Note that nested transactions are not allowed
479
+ # by SQLite, so attempting to nest a transaction will result in a runtime
480
+ # exception.
481
+ #
482
+ # The +mode+ parameter may be either <tt>:deferred</tt> (the default),
483
+ # <tt>:immediate</tt>, or <tt>:exclusive</tt>.
484
+ #
485
+ # If a block is given, the database instance is yielded to it, and the
486
+ # transaction is committed when the block terminates. If the block
487
+ # raises an exception, a rollback will be performed instead. Note that if
488
+ # a block is given, #commit and #rollback should never be called
489
+ # explicitly or you'll get an error when the block terminates.
490
+ #
491
+ # If a block is not given, it is the caller's responsibility to end the
492
+ # transaction explicitly, either by calling #commit, or by calling
493
+ # #rollback.
494
+ def transaction( mode = :deferred )
495
+ execute "begin #{mode.to_s} transaction"
496
+
497
+ if block_given?
498
+ abort = false
499
+ begin
500
+ yield self
501
+ rescue ::Object
502
+ abort = true
503
+ raise
504
+ ensure
505
+ abort and rollback or commit
506
+ end
507
+ end
508
+
509
+ true
510
+ end
511
+
512
+ # Commits the current transaction. If there is no current transaction,
513
+ # this will cause an error to be raised. This returns +true+, in order
514
+ # to allow it to be used in idioms like
515
+ # <tt>abort? and rollback or commit</tt>.
516
+ def commit
517
+ execute "commit transaction"
518
+ true
519
+ end
520
+
521
+ # Rolls the current transaction back. If there is no current transaction,
522
+ # this will cause an error to be raised. This returns +true+, in order
523
+ # to allow it to be used in idioms like
524
+ # <tt>abort? and rollback or commit</tt>.
525
+ def rollback
526
+ execute "rollback transaction"
527
+ true
528
+ end
529
+
530
+ # Returns +true+ if the database has been open in readonly mode
531
+ # A helper to check before performing any operation
532
+ def readonly?
533
+ @readonly
534
+ end
535
+
536
+ # A helper class for dealing with custom functions (see #create_function,
537
+ # #create_aggregate, and #create_aggregate_handler). It encapsulates the
538
+ # opaque function object that represents the current invocation. It also
539
+ # provides more convenient access to the API functions that operate on
540
+ # the function object.
541
+ #
542
+ # This class will almost _always_ be instantiated indirectly, by working
543
+ # with the create methods mentioned above.
544
+ class FunctionProxy
545
+ attr_accessor :result
546
+
547
+ # Create a new FunctionProxy that encapsulates the given +func+ object.
548
+ # If context is non-nil, the functions context will be set to that. If
549
+ # it is non-nil, it must quack like a Hash. If it is nil, then none of
550
+ # the context functions will be available.
551
+ def initialize
552
+ @result = nil
553
+ @context = {}
554
+ end
555
+
556
+ # Set the result of the function to the given error message.
557
+ # The function will then return that error.
558
+ def set_error( error )
559
+ @driver.result_error( @func, error.to_s, -1 )
560
+ end
561
+
562
+ # (Only available to aggregate functions.) Returns the number of rows
563
+ # that the aggregate has processed so far. This will include the current
564
+ # row, and so will always return at least 1.
565
+ def count
566
+ @driver.aggregate_count( @func )
567
+ end
568
+
569
+ # Returns the value with the given key from the context. This is only
570
+ # available to aggregate functions.
571
+ def []( key )
572
+ @context[ key ]
573
+ end
574
+
575
+ # Sets the value with the given key in the context. This is only
576
+ # available to aggregate functions.
577
+ def []=( key, value )
578
+ @context[ key ] = value
579
+ end
580
+ end
581
+
582
+ private
583
+
584
+ def ordered_map_for columns, row
585
+ h = Hash[*columns.zip(row).flatten]
586
+ row.each_with_index { |r, i| h[i] = r }
587
+ h
588
+ end
589
+ end
590
+ end
@@ -0,0 +1,44 @@
1
+ require 'sqlite3/constants'
2
+
3
+ module SQLite3
4
+ class Exception < ::StandardError
5
+ @code = 0
6
+
7
+ # The numeric error code that this exception represents.
8
+ def self.code
9
+ @code
10
+ end
11
+
12
+ # A convenience for accessing the error code for this exception.
13
+ def code
14
+ self.class.code
15
+ end
16
+ end
17
+
18
+ class SQLException < Exception; end
19
+ class InternalException < Exception; end
20
+ class PermissionException < Exception; end
21
+ class AbortException < Exception; end
22
+ class BusyException < Exception; end
23
+ class LockedException < Exception; end
24
+ class MemoryException < Exception; end
25
+ class ReadOnlyException < Exception; end
26
+ class InterruptException < Exception; end
27
+ class IOException < Exception; end
28
+ class CorruptException < Exception; end
29
+ class NotFoundException < Exception; end
30
+ class FullException < Exception; end
31
+ class CantOpenException < Exception; end
32
+ class ProtocolException < Exception; end
33
+ class EmptyException < Exception; end
34
+ class SchemaChangedException < Exception; end
35
+ class TooBigException < Exception; end
36
+ class ConstraintException < Exception; end
37
+ class MismatchException < Exception; end
38
+ class MisuseException < Exception; end
39
+ class UnsupportedException < Exception; end
40
+ class AuthorizationException < Exception; end
41
+ class FormatException < Exception; end
42
+ class RangeException < Exception; end
43
+ class NotADatabaseException < Exception; end
44
+ end