更新内核,API接口开发的一些尝试,后期会增加API接口开发这块
This commit is contained in:
@@ -51,7 +51,7 @@ class Mysql extends Connection
|
||||
*/
|
||||
public function getFields($tableName)
|
||||
{
|
||||
$this->initConnect(true);
|
||||
$this->initConnect(false);
|
||||
list($tableName) = explode(' ', $tableName);
|
||||
if (false === strpos($tableName, '`')) {
|
||||
if (strpos($tableName, '.')) {
|
||||
@@ -91,7 +91,7 @@ class Mysql extends Connection
|
||||
*/
|
||||
public function getTables($dbName = '')
|
||||
{
|
||||
$this->initConnect(true);
|
||||
$this->initConnect(false);
|
||||
$sql = !empty($dbName) ? 'SHOW TABLES FROM ' . $dbName : 'SHOW TABLES ';
|
||||
// 调试开始
|
||||
$this->debug(true);
|
||||
@@ -130,17 +130,4 @@ class Mysql extends Connection
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否断线
|
||||
* @access protected
|
||||
* @param \PDOException $e 异常对象
|
||||
* @return bool
|
||||
*/
|
||||
protected function isBreak($e)
|
||||
{
|
||||
if (false !== stripos($e->getMessage(), 'server has gone away')) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ class Pgsql extends Connection
|
||||
*/
|
||||
public function getFields($tableName)
|
||||
{
|
||||
$this->initConnect(true);
|
||||
$this->initConnect(false);
|
||||
list($tableName) = explode(' ', $tableName);
|
||||
$sql = 'select fields_name as "field",fields_type as "type",fields_not_null as "null",fields_key_name as "key",fields_default as "default",fields_default as "extra" from table_msg(\'' . $tableName . '\');';
|
||||
// 调试开始
|
||||
@@ -78,7 +78,7 @@ class Pgsql extends Connection
|
||||
*/
|
||||
public function getTables($dbName = '')
|
||||
{
|
||||
$this->initConnect(true);
|
||||
$this->initConnect(false);
|
||||
$sql = "select tablename as Tables_in_test from pg_tables where schemaname ='public'";
|
||||
// 调试开始
|
||||
$this->debug(true);
|
||||
|
||||
@@ -42,7 +42,7 @@ class Sqlite extends Connection
|
||||
*/
|
||||
public function getFields($tableName)
|
||||
{
|
||||
$this->initConnect(true);
|
||||
$this->initConnect(false);
|
||||
list($tableName) = explode(' ', $tableName);
|
||||
$sql = 'PRAGMA table_info( ' . $tableName . ' )';
|
||||
// 调试开始
|
||||
@@ -76,7 +76,7 @@ class Sqlite extends Connection
|
||||
*/
|
||||
public function getTables($dbName = '')
|
||||
{
|
||||
$this->initConnect(true);
|
||||
$this->initConnect(false);
|
||||
$sql = "SELECT name FROM sqlite_master WHERE type='table' "
|
||||
. "UNION ALL SELECT name FROM sqlite_temp_master "
|
||||
. "WHERE type='table' ORDER BY name";
|
||||
|
||||
@@ -49,7 +49,7 @@ class Sqlsrv extends Connection
|
||||
*/
|
||||
public function getFields($tableName)
|
||||
{
|
||||
$this->initConnect(true);
|
||||
$this->initConnect(false);
|
||||
list($tableName) = explode(' ', $tableName);
|
||||
$sql = "SELECT column_name, data_type, column_default, is_nullable
|
||||
FROM information_schema.tables AS t
|
||||
@@ -99,7 +99,7 @@ class Sqlsrv extends Connection
|
||||
*/
|
||||
public function getTables($dbName = '')
|
||||
{
|
||||
$this->initConnect(true);
|
||||
$this->initConnect(false);
|
||||
$sql = "SELECT TABLE_NAME
|
||||
FROM INFORMATION_SCHEMA.TABLES
|
||||
WHERE TABLE_TYPE = 'BASE TABLE'
|
||||
|
||||
Reference in New Issue
Block a user