mirror of
https://github.com/dg/dibi.git
synced 2025-08-06 06:07:39 +02:00
- implemented basic meta/reflection support
This commit is contained in:
@@ -185,6 +185,22 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the connection resource.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getResource()
|
||||
{
|
||||
return $this->connection;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/********************* SQL ****************d*g**/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Encodes data for use in an SQL statement.
|
||||
*
|
||||
@@ -258,6 +274,10 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
|
||||
|
||||
|
||||
|
||||
/********************* result set ****************d*g**/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the number of rows in a result set.
|
||||
*
|
||||
@@ -324,6 +344,7 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
|
||||
// items 'name' and 'table' are required
|
||||
$info = (array) mssql_fetch_field($this->resultSet, $i);
|
||||
$info['table'] = $info['column_source'];
|
||||
$info['nativetype'] = $info['type'];
|
||||
$meta[] = $info;
|
||||
}
|
||||
return $meta;
|
||||
@@ -331,18 +352,6 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the connection resource.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function getResource()
|
||||
{
|
||||
return $this->connection;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns the result set resource.
|
||||
*
|
||||
@@ -355,12 +364,53 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver
|
||||
|
||||
|
||||
|
||||
/********************* reflection ****************d*g**/
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Gets a information of the current database.
|
||||
*
|
||||
* @return DibiReflection
|
||||
* Returns list of tables.
|
||||
* @return array
|
||||
*/
|
||||
function getDibiReflection()
|
||||
{}
|
||||
public function getTables()
|
||||
{
|
||||
throw new NotImplementedException;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns metadata for all columns in a table.
|
||||
* @param string
|
||||
* @return array
|
||||
*/
|
||||
public function getColumns($table)
|
||||
{
|
||||
throw new NotImplementedException;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns metadata for all indexes in a table.
|
||||
* @param string
|
||||
* @return array
|
||||
*/
|
||||
public function getIndexes($table)
|
||||
{
|
||||
throw new NotImplementedException;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Returns metadata for all foreign keys in a table.
|
||||
* @param string
|
||||
* @return array
|
||||
*/
|
||||
public function getForeignKeys($table)
|
||||
{
|
||||
throw new NotImplementedException;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user