Module: Sequel::JDBC::Postgres::DatabaseMethods
- Includes:
- Postgres::DatabaseMethods
- Defined in:
- lib/sequel_core/adapters/jdbc/postgresql.rb
Overview
Methods to add to Database instances that access PostgreSQL via JDBC.
Class Method Summary collapse
-
.extended(db) ⇒ Object
Add the primary_keys and primary_key_sequences instance variables, so we can get the correct return values for inserted rows.
Instance Method Summary collapse
-
#dataset(opts = nil) ⇒ Object
Return instance of Sequel::JDBC::Postgres::Dataset with the given opts.
-
#execute_insert(sql, opts = {}) ⇒ Object
Run the INSERT sql on the database and return the primary key for the record.
Class Method Details
.extended(db) ⇒ Object
Add the primary_keys and primary_key_sequences instance variables, so we can get the correct return values for inserted rows.
48 49 50 51 52 53 |
# File 'lib/sequel_core/adapters/jdbc/postgresql.rb', line 48 def self.extended(db) db.instance_eval do @primary_keys = {} @primary_key_sequences = {} end end |
Instance Method Details
#dataset(opts = nil) ⇒ Object
Return instance of Sequel::JDBC::Postgres::Dataset with the given opts.
56 57 58 |
# File 'lib/sequel_core/adapters/jdbc/postgresql.rb', line 56 def dataset(opts=nil) Sequel::JDBC::Postgres::Dataset.new(self, opts) end |
#execute_insert(sql, opts = {}) ⇒ Object
Run the INSERT sql on the database and return the primary key for the record.
62 63 64 |
# File 'lib/sequel_core/adapters/jdbc/postgresql.rb', line 62 def execute_insert(sql, opts={}) super(sql, {:type=>:insert}.merge(opts)) end |