Class: BetterAuth::Adapters::MySQL
- Defined in:
- lib/better_auth/adapters/mysql.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) ⇒ MySQL
constructor
A new instance of MySQL.
Methods inherited from SQL
#count, #create, #delete, #delete_many, #find_many, #find_one, #transaction, #update, #update_many
Methods inherited from Base
#count, #create, #delete, #delete_many, #find_many, #find_one, #transaction, #update, #update_many
Constructor Details
#initialize(options = nil, url: nil, connection: nil) ⇒ MySQL
Returns a new instance of MySQL.
10 11 12 13 14 15 16 |
# File 'lib/better_auth/adapters/mysql.rb', line 10 def initialize( = nil, url: nil, connection: nil) require "mysql2" unless connection config = || Configuration.new(secret: Configuration::DEFAULT_SECRET, database: :memory) @url = url super(config, connection: connection || Mysql2::Client.new((url)), dialect: :mysql) end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
8 9 10 |
# File 'lib/better_auth/adapters/mysql.rb', line 8 def url @url end |