Module: Sequel::Swift::SQLite::DatabaseMethods

Extended by:
Database::ResetIdentifierMangling
Includes:
Sequel::SQLite::DatabaseMethods
Defined in:
lib/sequel/adapters/swift/sqlite.rb

Overview

Database instance methods for SQLite databases accessed via Swift.

Constant Summary collapse

DATABASE_ERROR_REGEXPS =
{
  /\AUNIQUE constraint failed: / => UniqueConstraintViolation,
  /\AFOREIGN KEY constraint failed/ => ForeignKeyConstraintViolation,
  /\ACHECK constraint failed/ => CheckConstraintViolation,
  /\A(SQLITE ERROR 19 \(CONSTRAINT\) : )?constraint failed/ => ConstraintViolation,
  /may not be NULL\z|NOT NULL constraint failed: .+/ => NotNullConstraintViolation,
  /\ASQLITE ERROR \d+ \(\) : CHECK constraint failed: / => CheckConstraintViolation
}.freeze

Constants included from Sequel::SQLite::DatabaseMethods

Sequel::SQLite::DatabaseMethods::AUTO_VACUUM, Sequel::SQLite::DatabaseMethods::PRIMARY_KEY_INDEX_RE, Sequel::SQLite::DatabaseMethods::SYNCHRONOUS, Sequel::SQLite::DatabaseMethods::TABLES_FILTER, Sequel::SQLite::DatabaseMethods::TEMP_STORE, Sequel::SQLite::DatabaseMethods::TRANSACTION_MODE, Sequel::SQLite::DatabaseMethods::VIEWS_FILTER

Instance Attribute Summary

Attributes included from Sequel::SQLite::DatabaseMethods

#integer_booleans, #transaction_mode, #use_timestamp_timezones

Instance Method Summary collapse

Methods included from Database::ResetIdentifierMangling

extended

Methods included from Sequel::SQLite::DatabaseMethods

#auto_vacuum, #auto_vacuum=, #case_sensitive_like=, #database_type, #foreign_key_list, #foreign_keys, #foreign_keys=, #indexes, #pragma_get, #pragma_set, #set_integer_booleans, #sqlite_version, #supports_create_table_if_not_exists?, #supports_deferrable_foreign_key_constraints?, #supports_partial_indexes?, #supports_savepoints?, #synchronous, #synchronous=, #tables, #temp_store, #temp_store=, #use_timestamp_timezones?, #values, #views

Instance Method Details

#connect(opts) ⇒ Object

Set the correct pragmas on the connection.



29
30
31
32
33
# File 'lib/sequel/adapters/swift/sqlite.rb', line 29

def connect(opts)
  c = super
  connection_pragmas.each{|s| log_connection_yield(s, c){c.execute(s)}}
  c
end

#database_error_regexpsObject



24
25
26
# File 'lib/sequel/adapters/swift/sqlite.rb', line 24

def database_error_regexps
  DATABASE_ERROR_REGEXPS
end