Module: MySql::Pervasive::DatabaseMethods

Defined in:
lib/sequel/mysql_pervasive_adapter.rb

Instance Method Summary collapse

Instance Method Details

#auto_increment_sqlObject

if its not windows/linux where pervasive db is running in tests modify the pervasive adapter to act more like mysql for certain things



17
# File 'lib/sequel/mysql_pervasive_adapter.rb', line 17

def auto_increment_sql;"AUTO_INCREMENT"; end

#begin_transaction_sqlObject



18
# File 'lib/sequel/mysql_pervasive_adapter.rb', line 18

def begin_transaction_sql; "BEGIN" end

#commit_transaction_sqlObject



19
# File 'lib/sequel/mysql_pervasive_adapter.rb', line 19

def commit_transaction_sql; "COMMIT" end

#dataset(opts = nil) ⇒ Object



5
6
7
8
9
# File 'lib/sequel/mysql_pervasive_adapter.rb', line 5

def dataset(opts = nil)
  ds = super
  ds.extend(DatasetMethods)
  ds
end

#get_column_type(column_name) ⇒ Object



22
23
24
25
26
27
# File 'lib/sequel/mysql_pervasive_adapter.rb', line 22

def get_column_type(column_name)
  if model and model.respond_to?(:datatypes) and model.datatypes and model.datatypes[column_name]
    return model.datatypes[column_name][:type]
  end
  nil
end

#rollback_transaction_sqlObject



20
# File 'lib/sequel/mysql_pervasive_adapter.rb', line 20

def rollback_transaction_sql; "ROLLBACK" end

#select_fields(table, *fields) ⇒ Object



11
12
13
# File 'lib/sequel/mysql_pervasive_adapter.rb', line 11

def select_fields(table, *fields)
  dataset.select_fields(table, *fields)
end