1111
1212
1313/**
14- * Supplemental PDO database driver .
14+ * Provides database-specific functionality .
1515 */
1616interface Driver
1717{
1818 public const
1919 SupportSequence = 'sequence ' ,
2020 SupportSelectUngroupedColumns = 'ungrouped_cols ' ,
2121 SupportMultiInsertAsSelect = 'insert_as_select ' ,
22- SupportMultiColumnAsOrCond = 'multi_column_as_or ' ,
22+ SupportMultiColumnAsOrCondition = 'multi_column_as_or ' ,
2323 SupportSubselect = 'subselect ' ,
2424 SupportSchema = 'schema ' ;
2525
@@ -32,6 +32,12 @@ interface Driver
3232 SUPPORT_SUBSELECT = 'subselect ' ,
3333 SUPPORT_SCHEMA = 'schema ' ;
3434
35+ /**
36+ * Checks if the engine supports a specific feature.
37+ * @param self::Support* $feature
38+ */
39+ function isSupported (string $ feature ): bool ;
40+
3541 /**
3642 * Initializes connection.
3743 */
@@ -42,56 +48,54 @@ function initialize(Connection $connection, array $options): void;
4248 */
4349 function convertException (\PDOException $ e ): DriverException ;
4450
45- /**
46- * Delimites identifier for use in a SQL statement.
47- */
51+ /********************* SQL utilities ****************d*g**/
52+
53+ /** Adds delimiters around database identifier. */
4854 function delimite (string $ name ): string ;
4955
50- /**
51- * Formats date-time for use in a SQL statement.
52- */
56+ /** Formats a date-time value for use in an SQL statement. */
5357 function formatDateTime (\DateTimeInterface $ value ): string ;
5458
55- /**
56- * Formats date-time interval for use in a SQL statement.
57- */
59+ /** Formats a date-time interval for use in an SQL statement. */
5860 function formatDateInterval (\DateInterval $ value ): string ;
5961
60- /**
61- * Encodes string for use in a LIKE statement.
62- */
62+ /** Encodes string for use in a LIKE statement. */
6363 function formatLike (string $ value , int $ pos ): string ;
6464
65- /**
66- * Injects LIMIT/OFFSET to the SQL query.
67- */
65+ /** Applies LIMIT and OFFSET clauses to an SQL query. */
6866 function applyLimit (string &$ sql , ?int $ limit , ?int $ offset ): void ;
6967
7068 /********************* reflection ****************d*g**/
7169
72- /** @return list<array{name: string, fullName: string, view: bool}> */
70+ /**
71+ * Returns a list of all tables in the database.
72+ * @return list<array{name: string, fullName: string, view: bool}>
73+ */
7374 function getTables (): array ;
7475
75- /** @return list<array{name: string, table: string, nativetype: string, size: int|null, nullable: bool, default: mixed, autoincrement: bool, primary: bool, vendor: array}> */
76+ /**
77+ * Returns metadata for all columns in a table.
78+ * @return list<array{name: string, table: string, nativetype: string, size: int|null, nullable: bool, default: mixed, autoincrement: bool, primary: bool, vendor: array}>
79+ */
7680 function getColumns (string $ table ): array ;
7781
78- /** @return list<array{name: string, columns: list<string>, unique: bool, primary: bool}> */
82+ /**
83+ * Returns metadata for all indexes in a table.
84+ * @return list<array{name: string, columns: list<string>, unique: bool, primary: bool}>
85+ */
7986 function getIndexes (string $ table ): array ;
8087
81- /** @return list<array{name: string, local: string, table: string, foreign: string}> */
88+ /**
89+ * Returns metadata for all foreign keys in a table.
90+ * @return list<array{name: string, local: string, table: string, foreign: string}>
91+ */
8292 function getForeignKeys (string $ table ): array ;
8393
8494 /**
8595 * Returns associative array of detected types (IStructure::FIELD_*) in result set.
8696 * @return array<string, string>
8797 */
8898 function getColumnTypes (\PDOStatement $ statement ): array ;
89-
90- /**
91- * Cheks if driver supports specific property
92- * @param self::Support* $item
93- */
94- function isSupported (string $ item ): bool ;
9599}
96100
97101
0 commit comments