You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

adapterpgsql.php 660B

1234567891011121314151617181920212223
  1. <?php
  2. /**
  3. * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. namespace OC\DB;
  9. class AdapterPgSql extends Adapter {
  10. public function lastInsertId($table) {
  11. return $this->conn->fetchColumn('SELECT lastval()');
  12. }
  13. const UNIX_TIMESTAMP_REPLACEMENT = 'cast(extract(epoch from current_timestamp) as integer)';
  14. public function fixupStatement($statement) {
  15. $statement = str_replace( '`', '"', $statement );
  16. $statement = str_ireplace( 'UNIX_TIMESTAMP()', self::UNIX_TIMESTAMP_REPLACEMENT, $statement );
  17. return $statement;
  18. }
  19. }