diff options
| author | 2016-10-01 19:35:14 +0200 | |
|---|---|---|
| committer | 2016-10-01 19:35:14 +0200 | |
| commit | 0ccf100568dc76bd88443fac13c5aef15fed9ff6 (patch) | |
| tree | 2b72a0afa0fc0fcbd97ed85192fa3737313e7298 /app/Models/EntryDAOPGSQL.php | |
| parent | 8a58795e7dfd501c6c8ac84694e695c4f0791cfb (diff) | |
| parent | 32ac41439a67e2c5777f9da80324fe0bfbf394ff (diff) | |
Merge pull request #1195 from Alkarex/PostgreSQL
PostgreSQL
Diffstat (limited to 'app/Models/EntryDAOPGSQL.php')
| -rw-r--r-- | app/Models/EntryDAOPGSQL.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/app/Models/EntryDAOPGSQL.php b/app/Models/EntryDAOPGSQL.php new file mode 100644 index 000000000..b96a62ebc --- /dev/null +++ b/app/Models/EntryDAOPGSQL.php @@ -0,0 +1,31 @@ +<?php + +class FreshRSS_EntryDAOPGSQL extends FreshRSS_EntryDAOSQLite { + + public function sqlHexDecode($x) { + return 'decode(' . $x . ", 'hex')"; + } + + public function sqlHexEncode($x) { + return 'encode(' . $x . ", 'hex')"; + } + + protected function autoUpdateDb($errorInfo) { + return false; + } + + protected function addColumn($name) { + return false; + } + + public function size($all = true) { + $db = FreshRSS_Context::$system_conf->db; + $sql = 'SELECT pg_size_pretty(pg_database_size(?))'; + $values = array($db['base']); + $stm = $this->bd->prepare($sql); + $stm->execute($values); + $res = $stm->fetchAll(PDO::FETCH_COLUMN, 0); + return $res[0]; + } + +} |
