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: */
11:
12: namespace Nette\Database;
13:
14: use Nette;
15:
16:
17:
18: /**
19: * Supplemental PDO database driver.
20: *
21: * @author David Grudl
22: */
23: interface ISupplementalDriver
24: {
25: const SUPPORT_COLUMNS_META = 'meta',
26: SUPPORT_SEQUENCE = 'sequence',
27: SUPPORT_SELECT_UNGROUPED_COLUMNS = 'ungrouped_cols';
28:
29: /**
30: * Delimites identifier for use in a SQL statement.
31: * @param string
32: * @return string
33: */
34: function delimite($name);
35:
36: /**
37: * Formats date-time for use in a SQL statement.
38: * @param \DateTime
39: * @return string
40: */
41: function formatDateTime(\DateTime $value);
42:
43: /**
44: * Encodes string for use in a LIKE statement.
45: * @param string
46: * @param int
47: * @return string
48: */
49: function formatLike($value, $pos);
50:
51: /**
52: * Injects LIMIT/OFFSET to the SQL query.
53: * @param string SQL query that will be modified.
54: * @param int
55: * @param int
56: * @return void
57: */
58: function applyLimit(&$sql, $limit, $offset);
59:
60: /**
61: * Normalizes result row.
62: * @param array
63: * @param Statement
64: * @return array
65: */
66: function normalizeRow($row, $statement);
67:
68:
69: /********************* reflection ****************d*g**/
70:
71:
72: /**
73: * Returns list of tables.
74: * @return array of [name [, (bool) view]]
75: */
76: function getTables();
77:
78: /**
79: * Returns metadata for all columns in a table.
80: * @param string
81: * @return array of [name, nativetype [, table, fullname, (int) size, (bool) nullable, (mixed) default, (bool) autoincrement, (array) vendor]]
82: */
83: function getColumns($table);
84:
85: /**
86: * Returns metadata for all indexes in a table.
87: * @param string
88: * @return array of [name, (array of names) columns [, (bool) unique, (bool) primary]]
89: */
90: function getIndexes($table);
91:
92: /**
93: * Returns metadata for all foreign keys in a table.
94: * @param string
95: * @return array
96: */
97: function getForeignKeys($table);
98:
99: /**
100: * Cheks if driver supports specific property
101: * @return bool
102: */
103: function isSupported($item);
104:
105: }
106: