Class: BetterAuth::Adapters::MSSQL
- Defined in:
- lib/better_auth/adapters/mssql.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Attributes inherited from SQL
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(options = nil, url: nil, connection: nil) ⇒ MSSQL
constructor
A new instance of MSSQL.
- #transaction ⇒ Object
Methods inherited from SQL
#count, #create, #delete, #delete_many, #find_many, #find_one, #update, #update_many
Methods inherited from Base
#count, #create, #delete, #delete_many, #find_many, #find_one, #update, #update_many
Constructor Details
#initialize(options = nil, url: nil, connection: nil) ⇒ MSSQL
Returns a new instance of MSSQL.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/better_auth/adapters/mssql.rb', line 8 def initialize( = nil, url: nil, connection: nil) unless connection require "sequel" require "tiny_tds" end config = || Configuration.new(secret: Configuration::DEFAULT_SECRET, database: :memory) @url = url super(config, connection: connection || Sequel.connect(url), dialect: :mssql) end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/better_auth/adapters/mssql.rb', line 6 def url @url end |
Instance Method Details
#transaction ⇒ Object
19 20 21 22 23 |
# File 'lib/better_auth/adapters/mssql.rb', line 19 def transaction return super unless connection.respond_to?(:transaction) connection.transaction { yield self } end |