1: <?php
2: /**
3: * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
4: * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
5: *
6: * Licensed under The MIT License
7: * For full copyright and license information, please see the LICENSE.txt
8: * Redistributions of files must retain the above copyright notice.
9: *
10: * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
11: * @link http://cakephp.org CakePHP(tm) Project
12: * @since 3.5.0
13: * @license http://www.opensource.org/licenses/mit-license.php MIT License
14: */
15: namespace Cake\Database\Schema;
16:
17: use Cake\Database\Connection;
18:
19: /**
20: * An interface used by TableSchema objects.
21: */
22: interface SqlGeneratorInterface
23: {
24: /**
25: * Generate the SQL to create the Table.
26: *
27: * Uses the connection to access the schema dialect
28: * to generate platform specific SQL.
29: *
30: * @param \Cake\Database\Connection $connection The connection to generate SQL for.
31: * @return array List of SQL statements to create the table and the
32: * required indexes.
33: */
34: public function createSql(Connection $connection);
35:
36: /**
37: * Generate the SQL to drop a table.
38: *
39: * Uses the connection to access the schema dialect to generate platform
40: * specific SQL.
41: *
42: * @param \Cake\Database\Connection $connection The connection to generate SQL for.
43: * @return array SQL to drop a table.
44: */
45: public function dropSql(Connection $connection);
46:
47: /**
48: * Generate the SQL statements to truncate a table
49: *
50: * @param \Cake\Database\Connection $connection The connection to generate SQL for.
51: * @return array SQL to truncate a table.
52: */
53: public function truncateSql(Connection $connection);
54:
55: /**
56: * Generate the SQL statements to add the constraints to the table
57: *
58: * @param \Cake\Database\Connection $connection The connection to generate SQL for.
59: * @return array SQL to add the constraints.
60: */
61: public function addConstraintSql(Connection $connection);
62:
63: /**
64: * Generate the SQL statements to drop the constraints to the table
65: *
66: * @param \Cake\Database\Connection $connection The connection to generate SQL for.
67: * @return array SQL to drop a table.
68: */
69: public function dropConstraintSql(Connection $connection);
70: }
71: