| 1 | package Oryx::DBI::Util::Pg; | ||
| 2 | |||
| 3 | use base qw(Oryx::DBI::Util); | ||
| 4 | |||
| 5 | our %SQL_TYPES = ( | ||
| 6 | 'Oid' => 'serial PRIMARY KEY', | ||
| 7 | 'Integer' => 'integer', | ||
| 8 | 'String' => 'varchar', | ||
| 9 | 'Text' => 'text', | ||
| 10 | 'Binary' => 'bytea', | ||
| 11 | 'Float' => 'numeric', | ||
| 12 | 'Boolean' => 'integer', | ||
| 13 | 'DateTime' => 'timestamp', | ||
| 14 | ); | ||
| 15 | |||
| 16 | sub lastval { | ||
| 17 | my ($self, $dbh, $table) = @_; | ||
| 18 | return $dbh->last_insert_id('%', 'public', $table, 'id'); | ||
| 19 | } | ||
| 20 | |||
| 21 | 1; | ||
| 22 | __END__ |