Class: RailsDb::Adapters::BaseAdapter
- Inherits:
-
Object
- Object
- RailsDb::Adapters::BaseAdapter
show all
- Extended by:
- Connection
- Defined in:
- lib/rails_db/adapters/base_adapter.rb
Constant Summary
collapse
- MULTI_STATEMENT_HELP_TEXT =
"EXPERIMENTAL: You can import only file with SQL statements separated by ';'. Each new statement must start from new line."
Class Method Summary
collapse
Methods included from Connection
column_names, column_properties, columns, connection, to_param
Class Method Details
.adapter_name ⇒ Object
23
24
25
|
# File 'lib/rails_db/adapters/base_adapter.rb', line 23
def self.adapter_name
'base'
end
|
.exec_query(sql, log = true) ⇒ Object
15
16
17
18
19
20
21
|
# File 'lib/rails_db/adapters/base_adapter.rb', line 15
def self.exec_query(sql, log = true)
t0 = Time.now
Rails.logger.debug "--> Executing: #{sql}" if log
results = connection.exec_query(sql)
execution_time = Time.now - t0
[results, execution_time]
end
|
.execute(sql) ⇒ Object
9
10
11
12
13
|
# File 'lib/rails_db/adapters/base_adapter.rb', line 9
def self.execute(sql)
t0 = Time.now
connection.execute(sql)
Time.now - t0
end
|
.mime ⇒ Object
27
28
29
|
# File 'lib/rails_db/adapters/base_adapter.rb', line 27
def self.mime
'text/x-sql'
end
|