Class: BetterAuth::Adapters::Postgres
- Defined in:
- lib/better_auth/adapters/postgres.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) ⇒ Postgres
constructor
A new instance of Postgres.
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) ⇒ Postgres
Returns a new instance of Postgres.
8 9 10 11 12 13 14 |
# File 'lib/better_auth/adapters/postgres.rb', line 8 def initialize( = nil, url: nil, connection: nil) require "pg" unless connection config = || Configuration.new(secret: Configuration::DEFAULT_SECRET, database: :memory) @url = url super(config, connection: connection || PG.connect(url), dialect: :postgres) end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
6 7 8 |
# File 'lib/better_auth/adapters/postgres.rb', line 6 def url @url end |