-
Notifications
You must be signed in to change notification settings - Fork 65
/
IPdoDataSourceProvider.class.php
78 lines (68 loc) · 1.86 KB
/
IPdoDataSourceProvider.class.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
Library::import('recess.database.pdo.RecessTableDescriptor');
Library::import('recess.database.pdo.RecessColumnDescriptor');
Library::import('recess.database.pdo.RecessType');
/**
* Interface for vendor specific operations needed by PdoDataSource.
*
* @author Kris Jordan <krisjordan@gmail.com>
* @copyright 2008 Kris Jordan
* @package Recess! Framework
* @license MIT
* @link http://www.recessframework.org/
*/
interface IPdoDataSourceProvider {
/**
* Initialize with a reference back to the PDO object.
*
* @param PDO $pdo
*/
function init(PDO $pdo);
/**
* List the tables in a data source alphabetically.
* @return array(string) The tables in the data source
*/
function getTables();
/**
* List the column names of a table alphabetically.
* @param string $table Table whose columns to list.
* @return array(string) Column names sorted alphabetically.
*/
function getColumns($table);
/**
* Retrieve the a table's RecessTableDescriptor.
*
* @param string $table Name of table.
* @return RecessTableDescriptor
*/
function getTableDescriptor($table);
/**
* Sanity check and semantic sugar from higher level
* representation of table pushed down to the RDBMS
* representation of the table.
*
* @param string $table
* @param RecessTableDescriptor $descriptor
*/
function cascadeTableDescriptor($table, RecessTableDescriptor $descriptor);
/**
* Drop a table from the data source.
*
* @param string $table Table to drop.
*/
function dropTable($table);
/**
* Empty a table in the data source.
*
* @param string $table Table to drop.
*/
function emptyTable($table);
/**
* Given a Table Definition, return the CREATE TABLE SQL statement
* in the provider's desired syntax.
*
* @param RecessTableDescriptor $tableDescriptor
*/
function createTableSql(RecessTableDescriptor $tableDescriptor);
}
?>