Class: Mssql
- Inherits:
-
Object
- Object
- Mssql
- Defined in:
- lib/adapters/mssql.rb
Instance Method Summary collapse
- #fields(table) ⇒ Object
-
#initialize(details) ⇒ Mssql
constructor
A new instance of Mssql.
- #query(sql) ⇒ Object
Constructor Details
#initialize(details) ⇒ Mssql
Returns a new instance of Mssql.
5 6 7 |
# File 'lib/adapters/mssql.rb', line 5 def initialize(details) @client = TinyTds::Client.new(details) end |
Instance Method Details
#fields(table) ⇒ Object
13 14 15 |
# File 'lib/adapters/mssql.rb', line 13 def fields(table) query('select * from ' + table.to_s).fields end |
#query(sql) ⇒ Object
9 10 11 |
# File 'lib/adapters/mssql.rb', line 9 def query(sql) @client.execute(sql) end |