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.24.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.23.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.22.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.21.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.20.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.19.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.18.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.17.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.16.0 lib/sequel/adapters/swift/sqlite.rb
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/sequel-4.15.0/lib/sequel/adapters/swift/sqlite.rb
sequel-4.15.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.14.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.13.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.12.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.11.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.10.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.9.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.8.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.7.0 lib/sequel/adapters/swift/sqlite.rb
sequel-4.6.0 lib/sequel/adapters/swift/sqlite.rb