1: <?php
2:
3: /**
4: * This file is part of the Nette Framework (https://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: * @return string
33: */
34: function formatDateTime(DateTime $value);
35:
36: /**
37: * Encodes string for use in a LIKE statement.
38: * @param string
39: * @param int
40: * @return string
41: */
42: function formatLike($value, $pos);
43:
44: /**
45: * Injects LIMIT/OFFSET to the SQL query.
46: * @param string SQL query that will be modified.
47: * @param int
48: * @param int
49: * @return void
50: */
51: function applyLimit(& $sql, $limit, $offset);
52:
53: /**
54: * Normalizes result row.
55: * @param array
56: * @param Statement
57: * @return array
58: */
59: function normalizeRow($row, $statement);
60:
61:
62: /********************* reflection ****************d*g**/
63:
64:
65: /**
66: * Returns list of tables.
67: * @return array of [name [, (bool) view]]
68: */
69: function getTables();
70:
71: /**
72: * Returns metadata for all columns in a table.
73: * @param string
74: * @return array of [name, nativetype [, table, fullname, (int) size, (bool) nullable, (mixed) default, (bool) autoincrement, (array) vendor]]
75: */
76: function getColumns($table);
77:
78: /**
79: * Returns metadata for all indexes in a table.
80: * @param string
81: * @return array of [name, (array of names) columns [, (bool) unique, (bool) primary]]
82: */
83: function getIndexes($table);
84:
85: /**
86: * Returns metadata for all foreign keys in a table.
87: * @param string
88: * @return array
89: */
90: function getForeignKeys($table);
91:
92: /**
93: * Cheks if driver supports specific property
94: * @return bool
95: */
96: function isSupported($item);
97:
98: }
99: