Added DB Types for drivers

v2-beta
Bruno O. Notario 10 months ago
parent 25de60c128
commit 1bb2ba8d0e
Signed by: oliveira131
GPG Key ID: 76CAD698D3EA8F58
  1. 13
      system/MagiQL/Manipulation/AbstractBaseQuery.php
  2. 22
      system/database/Databases/MSSQL.php
  3. 22
      system/database/Databases/MySQL_PDO.php
  4. 23
      system/database/Databases/MySQL_legacy.php
  5. 27
      system/database/Databases/MySQLi.php
  6. 19
      system/database/Databases/Oracle.php
  7. 25
      system/database/Databases/Oracle_PDO.php
  8. 19
      system/database/Databases/Postgre.php
  9. 21
      system/database/Databases/SQLSRV.php
  10. 19
      system/database/Databases/SQLite3.php
  11. 21
      system/database/Databases/mPDO.php
  12. 20
      system/database/Databases/nullStatement.php
  13. 21
      system/database/Databases/sqlsrvPDO.php
  14. 22
      system/database/autoload.php
  15. 29
      system/engine/interfaces/databases.php

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -16,6 +16,11 @@ use Phacil\Framework\Interfaces\Databases;
* @package Phacil\Framework\Databases
*/
class Oracle implements Databases {
const DB_TYPE = 'Oracle';
const DB_TYPE_ID = 3;
/**
*
* @var resource|false
@ -155,4 +160,18 @@ class Oracle implements Databases {
return $sql;
}
/**
* {@inheritdoc}
*/
public function getDBType() {
return self::DB_TYPE;
}
/**
* {@inheritdoc}
*/
public function getDBTypeId() {
return self::DB_TYPE_ID;
}
}

File diff suppressed because one or more lines are too long

@ -11,6 +11,11 @@ namespace Phacil\Framework\Databases;
use Phacil\Framework\Interfaces\Databases;
class Postgre implements Databases {
const DB_TYPE = 'Postgre';
const DB_TYPE_ID = 4;
/**
*
* @var resource|false
@ -155,4 +160,18 @@ class Postgre implements Databases {
return $sql;
}
/**
* {@inheritdoc}
*/
public function getDBType() {
return self::DB_TYPE;
}
/**
* {@inheritdoc}
*/
public function getDBTypeId() {
return self::DB_TYPE_ID;
}
}

File diff suppressed because one or more lines are too long

@ -13,6 +13,11 @@ use \SQLite3 as nativeSQLite3;
use \stdClass;
class SQLite3 implements Databases {
const DB_TYPE = 'SQLite3';
const DB_TYPE_ID = 5;
/**
*
* @var nativeSQLite3
@ -158,4 +163,18 @@ class SQLite3 implements Databases {
return $this->query($sql);
}
}
/**
* {@inheritdoc}
*/
public function getDBType() {
return self::DB_TYPE;
}
/**
* {@inheritdoc}
*/
public function getDBTypeId() {
return self::DB_TYPE_ID;
}
}

@ -16,6 +16,11 @@ use Phacil\Framework\Interfaces\Databases;
*
* @package Phacil\Framework\Databases */
class mPDO implements Databases {
const DB_TYPE = 'MySQL';
const DB_TYPE_ID = 1;
/**
*
* @var PDO
@ -198,4 +203,20 @@ class mPDO implements Databases {
return $paramType;
}
/**
*
* {@inheritdoc}
*/
public function getDBType() {
return self::DB_TYPE;
}
/**
*
* {@inheritdoc}
*/
public function getDBTypeId() {
return self::DB_TYPE_ID;
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -259,4 +259,26 @@ final class Database {
{
return $this->driver->execute($sql, $params);
}
/**
* Textual database driver type
* @return string
*/
public function getDBType() {
return $this->driver->getDBType();
}
/**
* ID of database driver
*
* @return int 1 = MySQL/MariaDB
* @return int 2 = MS SQL Server
* @return int 3 = Oracle Database
* @return int 4 = Postgre
* @return int 5 = SQLite3
* @return int 0 = NULL
*/
public function getDBTypeId() {
return $this->driver->getDBTypeId();
}
}

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save