Module: YeSQL::Common::Adapter

Extended by:
Forwardable
Included in:
Bindings::Extract, Bindings::Transformed, Query::Result, Query::TransformResult, Statement
Defined in:
lib/yesql/common/adapter.rb

Instance Method Summary collapse

Instance Method Details

#adapterObject

‘adapter` might be a complex object, but for the sake of brevity it’s just a string



12
13
14
# File 'lib/yesql/common/adapter.rb', line 12

def adapter
  ::ActiveRecord::Base.connection.adapter_name
end

#mysql?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/yesql/common/adapter.rb', line 16

def mysql?
  adapter == "Mysql2"
end

#pg?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/yesql/common/adapter.rb', line 20

def pg?
  adapter == "PostgreSQL"
end