|
|
@@ -32,6 +32,14 @@ class Core_Pdo extends PDO {
|
|
|
return strtolower($this->_type);
|
|
|
}
|
|
|
|
|
|
+ public function identifierQuote($identifier) {
|
|
|
+ switch (strtolower($this->_type)) {
|
|
|
+ case 'pgsql': return $identifier; // "'{$identifier}'";
|
|
|
+ case 'mysql': return "`{$identifier}`";
|
|
|
+ }
|
|
|
+ return $identifier;
|
|
|
+ }
|
|
|
+
|
|
|
public function getTableStruct($tblName) {// TODO: mved to Core_Storage_*
|
|
|
$sth = $this->prepare("
|
|
|
-- show fields from {$tblName}
|
|
|
@@ -437,6 +445,15 @@ EOF_STRUCT_MYSQL;
|
|
|
return $sth->fetch();
|
|
|
}
|
|
|
|
|
|
+ public function fetchFirstNoLog($sql, $values = []) { // fetch only first row - used in User::getID() required in DBG
|
|
|
+ $sth = $this->prepare($sql);
|
|
|
+ if (!empty($values)) {
|
|
|
+ $this->bindValues($sth, $values);
|
|
|
+ }
|
|
|
+ $sth->execute();
|
|
|
+ return $sth->fetch();
|
|
|
+ }
|
|
|
+
|
|
|
public function fetchAll($sql, $values = []) {
|
|
|
$sth = $this->prepare($sql);
|
|
|
if (!empty($values)) {
|