Class: BetterAuth::Adapters::SQLite
- Defined in:
- lib/better_auth/adapters/sqlite.rb
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Attributes inherited from SQL
Attributes inherited from Base
Instance Method Summary collapse
-
#initialize(options = nil, path: nil, connection: nil) ⇒ SQLite
constructor
A new instance of SQLite.
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, path: nil, connection: nil) ⇒ SQLite
Returns a new instance of SQLite.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/better_auth/adapters/sqlite.rb', line 8 def initialize( = nil, path: nil, connection: nil) require "sqlite3" unless connection config = || Configuration.new(secret: Configuration::DEFAULT_SECRET, database: :memory) @path = path || ":memory:" connection ||= SQLite3::Database.new(@path) connection.results_as_hash = true if connection.respond_to?(:results_as_hash=) connection.execute("PRAGMA foreign_keys = ON") if connection.respond_to?(:execute) super(config, connection: connection, dialect: :sqlite) end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
6 7 8 |
# File 'lib/better_auth/adapters/sqlite.rb', line 6 def path @path end |