Class: Baza::Driver::Tiny::Commands
- Inherits:
-
Object
- Object
- Baza::Driver::Tiny::Commands
- Defined in:
- lib/baza/driver/tiny/commands.rb
Instance Method Summary collapse
-
#initialize(db:) ⇒ Commands
constructor
A new instance of Commands.
- #last_id ⇒ Object
Constructor Details
#initialize(db:) ⇒ Commands
Returns a new instance of Commands.
2 3 4 |
# File 'lib/baza/driver/tiny/commands.rb', line 2 def initialize(db:) @db = db end |
Instance Method Details
#last_id ⇒ Object
6 7 8 |
# File 'lib/baza/driver/tiny/commands.rb', line 6 def last_id @db.query("SELECT SCOPE_IDENTITY() AS id").first.fetch(:id) end |