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: /**
26: * Generate the SQL to create the Table.
27: *
28: * Uses the connection to access the schema dialect
29: * to generate platform specific SQL.
30: *
31: * @param \Cake\Database\Connection $connection The connection to generate SQL for.
32: * @return array List of SQL statements to create the table and the
33: * required indexes.
34: */
35: public function createSql(Connection $connection);
36:
37: /**
38: * Generate the SQL to drop a table.
39: *
40: * Uses the connection to access the schema dialect to generate platform
41: * specific SQL.
42: *
43: * @param \Cake\Database\Connection $connection The connection to generate SQL for.
44: * @return array SQL to drop a table.
45: */
46: public function dropSql(Connection $connection);
47:
48: /**
49: * Generate the SQL statements to truncate a table
50: *
51: * @param \Cake\Database\Connection $connection The connection to generate SQL for.
52: * @return array SQL to truncate a table.
53: */
54: public function truncateSql(Connection $connection);
55:
56: /**
57: * Generate the SQL statements to add the constraints to the table
58: *
59: * @param \Cake\Database\Connection $connection The connection to generate SQL for.
60: * @return array SQL to add the constraints.
61: */
62: public function addConstraintSql(Connection $connection);
63:
64: /**
65: * Generate the SQL statements to drop the constraints to the table
66: *
67: * @param \Cake\Database\Connection $connection The connection to generate SQL for.
68: * @return array SQL to drop a table.
69: */
70: public function dropConstraintSql(Connection $connection);
71: }
72: