Class: Arc::DataStores::MysqlDataStore

Inherits:
AbstractDataStore show all
Defined in:
lib/arc/data_stores/mysql/store.rb

Constant Summary

Constants included from Casting

Casting::CAST_METHODS, Casting::TYPES

Instance Method Summary collapse

Methods inherited from AbstractDataStore

#[], #create, #destroy, #read, #result_for, #type_mappings_for, #update

Methods included from Casting

#cast

Methods included from Quoting

#quote, #quote_table

Methods included from ArelCompatibility

#columns_hash, #connection, #connection_pool, #primary_key, #quote_hash, #spec, #table_exists?, #visitor, #with_connection

Instance Method Details

#cast_blob(data) ⇒ Object



27
28
29
30
# File 'lib/arc/data_stores/mysql/store.rb', line 27

def cast_blob data
  debugger
  data
end

#execute(query) ⇒ Object



16
17
18
19
20
21
# File 'lib/arc/data_stores/mysql/store.rb', line 16

def execute query
  result = with_store do |store|
    store.query query
  end
  result.entries if result.respond_to? :entries
end

#quote_blob(data) ⇒ Object



31
32
33
34
35
# File 'lib/arc/data_stores/mysql/store.rb', line 31

def quote_blob data
  with_store do |store|
    "'#{store.escape(data).force_encoding("BINARY")}'"
  end
end

#quote_column_name(table) ⇒ Object Also known as: quote_column



11
12
13
# File 'lib/arc/data_stores/mysql/store.rb', line 11

def quote_column_name table
  "`#{table}`"
end

#schemaObject



23
24
25
# File 'lib/arc/data_stores/mysql/store.rb', line 23

def schema
  @schema ||= ObjectDefinitions::MysqlSchema.new self
end