Sha256: 1b3f1261b77377abac821e29181825572c6ac1b03b6152aeae453c841f6a85bd

Contents?: true

Size: 1012 Bytes

Versions: 27

Compression:

Stored size: 1012 Bytes

Contents

require 'swift/db/sqlite3'
Sequel.require 'adapters/shared/sqlite'

module Sequel
  module Swift
    # Database and Dataset instance methods for SQLite specific
    # support via Swift.
    module SQLite
      # Database instance methods for SQLite databases accessed via Swift.
      module DatabaseMethods
        extend Sequel::Database::ResetIdentifierMangling
        include Sequel::SQLite::DatabaseMethods

        # Set the correct pragmas on the connection.
        def connect(opts)
          c = super
          connection_pragmas.each{|s| log_yield(s){c.execute(s)}}
          c
        end
      end
      
      # Dataset class for SQLite datasets accessed via Swift.
      class Dataset < Swift::Dataset
        include Sequel::SQLite::DatasetMethods
        
        private
        
        # Use Swift's escape method for quoting.
        def literal_string_append(sql, s)
          sql << APOS << db.synchronize(@opts[:server]){|c| c.escape(s)} << APOS
        end
      end
    end
  end
end

Version data entries

27 entries across 27 versions & 2 rubygems

Version Path
sequel-4.5.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.4.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.3.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.2.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.1.1 lib/sequel/adapters/swift/sqlite.rb
sequel-4.1.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.0.0 lib/sequel/adapters/swift/sqlite.rb