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