1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (http://nette.org)
5: *
6: * Copyright (c) 2004 David Grudl (http://davidgrudl.com)
7: *
8: * For the full copyright and license information, please view
9: * the file license.txt that was distributed with this source code.
10: * @package Nette\Database
11: */
12:
13:
14:
15: /**
16: * Supplemental PDO database driver.
17: *
18: * @author David Grudl
19: * @package Nette\Database
20: */
21: interface ISupplementalDriver
22: {
23: const META = 'meta';
24:
25: /**
26: * Delimites identifier for use in a SQL statement.
27: * @param string
28: * @return string
29: */
30: function delimite($name);
31:
32: /**
33: * Formats date-time for use in a SQL statement.
34: * @param DateTime
35: * @return string
36: */
37: function formatDateTime(DateTime $value);
38:
39: /**
40: * Encodes string for use in a LIKE statement.
41: * @param string
42: * @param int
43: * @return string
44: */
45: function formatLike($value, $pos);
46:
47: /**
48: * Injects LIMIT/OFFSET to the SQL query.
49: * @param string SQL query that will be modified.
50: * @param int
51: * @param int
52: * @return void
53: */
54: function applyLimit(&$sql, $limit, $offset);
55:
56: /**
57: * Normalizes result row.
58: * @param array
59: * @param Statement
60: * @return array
61: */
62: function normalizeRow($row, $statement);
63:
64:
65: /********************* reflection ****************d*g**/
66:
67:
68: /**
69: * Returns list of tables.
70: * @return array of [name [, (bool) view]]
71: */
72: function getTables();
73:
74: /**
75: * Returns metadata for all columns in a table.
76: * @param string
77: * @return array of [name, nativetype [, table, fullname, (int) size, (bool) nullable, (mixed) default, (bool) autoincrement, (array) vendor]]
78: */
79: function getColumns($table);
80:
81: /**
82: * Returns metadata for all indexes in a table.
83: * @param string
84: * @return array of [name, (array of names) columns [, (bool) unique, (bool) primary]]
85: */
86: function getIndexes($table);
87:
88: /**
89: * Returns metadata for all foreign keys in a table.
90: * @param string
91: * @return array
92: */
93: function getForeignKeys($table);
94:
95: }
96: