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