Class: PGrow
- Inherits:
-
Array
- Object
- Array
- PGrow
- Defined in:
- ext/postgres.c,
ext/postgres.c
Overview
******************************************************************
Array subclass that provides hash-like behavior.
Instance Method Summary collapse
-
#[] ⇒ Object
Access elements of this row by column position or name.
-
#each ⇒ Object
Iterate with values or column,value pairs.
-
#each_key {|column| ... } ⇒ Object
Iterate with column names.
-
#each_pair {|column_value_array| ... } ⇒ Object
Iterate with column,value pairs.
-
#each_value {|value| ... } ⇒ Object
Iterate with values.
-
#initialize ⇒ Object
constructor
call-seq: PGconn.open(connection_hash) -> PGconn PGconn.open(connection_string) -> PGconn PGconn.open(host, port, options, tty, dbname, login, passwd) -> PGconn.
-
#keys ⇒ Array
Column names.
-
#to_hash ⇒ Hash
Returns a
Hashof the row’s values indexed by column name. - #values ⇒ Object
Constructor Details
#initialize ⇒ Object
call-seq:
PGconn.open(connection_hash) -> PGconn
PGconn.open(connection_string) -> PGconn
PGconn.open(host, port, , tty, dbname, login, passwd) -> PGconn
_host_:: server hostname
_port_:: server port number
_options_:: backend (String)
_tty_:: tty to print backend debug <i>(ignored in newer versions of PostgreSQL)</i> (String)
_dbname_:: connecting database name
_login_:: login user name
_passwd_:: login password
On failure, it raises a PGError exception.
2437 2438 2439 |
# File 'ext/postgres.c', line 2437 static VALUE pgrow_init(self, keys) VALUE self, keys; |
Instance Method Details
#[](position) ⇒ Object #[](name) ⇒ Object
Access elements of this row by column position or name.
2478 2479 2480 |
# File 'ext/postgres.c', line 2478 static VALUE pgrow_aref(argc, argv, self) int argc; |
#each {|column, value| ... } ⇒ Object #each {|value| ... } ⇒ Object
Iterate with values or column,value pairs.
2538 2539 2540 |
# File 'ext/postgres.c', line 2538 static VALUE pgrow_each(self) VALUE self; |
#each_key {|column| ... } ⇒ Object
Iterate with column names.
2558 2559 2560 |
# File 'ext/postgres.c', line 2558 static VALUE pgrow_each_key(self) VALUE self; |
#each_pair {|column_value_array| ... } ⇒ Object
Iterate with column,value pairs.
2519 2520 2521 |
# File 'ext/postgres.c', line 2519 static VALUE pgrow_each_pair(self) VALUE self; |
#each_value {|value| ... } ⇒ Object
Iterate with values.
2505 2506 2507 |
# File 'ext/postgres.c', line 2505 static VALUE pgrow_each_value(self) VALUE self; |
#keys ⇒ Array
Column names.
2453 2454 2455 |
# File 'ext/postgres.c', line 2453 static VALUE pgrow_keys(self) VALUE self; |
#to_hash ⇒ Hash
Returns a Hash of the row’s values indexed by column name. Equivalent to Hash [*row.keys.zip(row).flatten]
2573 2574 2575 |
# File 'ext/postgres.c', line 2573 static VALUE pgrow_to_hash(self) VALUE self; |
#values ⇒ Object
2464 2465 2466 |
# File 'ext/postgres.c', line 2464 static VALUE pgrow_values(self) VALUE self; |