Class: Rubernate::DBI::PgRuntime
- Inherits:
-
Runtime
- Object
- Runtime
- Rubernate::DBI::PgRuntime
- Defined in:
- lib/rubernate/impl/dbi_pg.rb
Instance Method Summary collapse
-
#close ⇒ Object
Issues ‘COMMIT’ against database.
-
#create(object) ⇒ Object
Creates record in r_objects for specified object.
- #failed ⇒ Object
-
#initialize(dbh) ⇒ PgRuntime
constructor
Invokes super and then issues ‘BEGIN’.
Constructor Details
#initialize(dbh) ⇒ PgRuntime
Invokes super and then issues ‘BEGIN’
17 18 19 20 21 |
# File 'lib/rubernate/impl/dbi_pg.rb', line 17 def initialize dbh super dbh.do 'BEGIN' @pk_gen = PKGenerator.new end |
Instance Method Details
#close ⇒ Object
Issues ‘COMMIT’ against database.
33 34 35 36 |
# File 'lib/rubernate/impl/dbi_pg.rb', line 33 def close dbh.do 'COMMIT' @pk_gen.release end |
#create(object) ⇒ Object
Creates record in r_objects for specified object
24 25 26 27 28 29 30 |
# File 'lib/rubernate/impl/dbi_pg.rb', line 24 def create object object.__peer = Rubernate::Peer.new unless object.__peer object.primary_key = @pk_gen.generate @dbh object.__virtual = true object.__peer.dirty = true object.primary_key end |
#failed ⇒ Object
38 39 40 |
# File 'lib/rubernate/impl/dbi_pg.rb', line 38 def failed @pk_gen.release end |