PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / 5.2.0
Matomo Analytics – Powerful, Privacy-First Insights for WordPress v5.2.0
5.11.1 5.11.0 5.10.2 5.10.1 trunk 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.3.2 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.1.3 4.10.0 4.11.0 4.12.0 4.13.0 4.13.2 4.13.3 4.13.4 4.13.5 4.14.0 4.14.1 4.14.2 4.15.0 4.15.1 4.15.2 4.15.3 4.2.0 4.3.0 4.3.1 4.4.1 4.4.2 4.5.0 4.6.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.10.0 5.2.0 5.2.1 5.2.2 5.3.0 5.3.1 5.3.2 5.3.3 5.6.0 5.6.1 5.7.0 5.7.1 5.8.0 5.8.1 5.8.2
matomo / app / core / Db / SchemaInterface.php
matomo / app / core / Db Last commit date
Adapter 1 year ago Schema 1 year ago Adapter.php 1 year ago AdapterInterface.php 1 year ago BatchInsert.php 1 year ago Schema.php 1 year ago SchemaInterface.php 1 year ago Settings.php 1 year ago TransactionLevel.php 1 year ago TransactionalDatabaseDynamicTrait.php 1 year ago TransactionalDatabaseInterface.php 1 year ago TransactionalDatabaseStaticTrait.php 1 year ago
SchemaInterface.php
165 lines
1 <?php
2
3 /**
4 * Matomo - free/libre analytics platform
5 *
6 * @link https://matomo.org
7 * @license https://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
8 */
9 namespace Piwik\Db;
10
11 /**
12 * Database schema interface
13 */
14 interface SchemaInterface
15 {
16 /**
17 * Get the SQL to create a specific Matomo table
18 *
19 * @param string $tableName
20 * @return string SQL
21 */
22 public function getTableCreateSql($tableName);
23 /**
24 * Get the SQL to create Matomo tables
25 *
26 * @return array array of strings containing SQL
27 */
28 public function getTablesCreateSql();
29 /**
30 * Creates a new table in the database.
31 *
32 * @param string $nameWithoutPrefix The name of the table without any prefix.
33 * @param string $createDefinition The table create definition
34 */
35 public function createTable($nameWithoutPrefix, $createDefinition);
36 /**
37 * Create database
38 *
39 * @param string $dbName Name of the database to create
40 */
41 public function createDatabase($dbName = null);
42 /**
43 * Drop database
44 */
45 public function dropDatabase();
46 /**
47 * Create all tables
48 */
49 public function createTables();
50 /**
51 * Creates an entry in the User table for the "anonymous" user.
52 */
53 public function createAnonymousUser();
54 /**
55 * Records the Matomo version a user used when installing this Matomo for the first time
56 */
57 public function recordInstallVersion();
58 /**
59 * Returns which Matomo version was used to install this Matomo for the first time.
60 */
61 public function getInstallVersion();
62 /**
63 * Returns the supported read isolation transaction level
64 *
65 * For example:
66 * READ COMMITTED
67 * or
68 * READ UNCOMMITTED
69 */
70 public function getSupportedReadIsolationTransactionLevel() : string;
71 /**
72 * Truncate all tables
73 */
74 public function truncateAllTables();
75 /**
76 * Names of all the prefixed tables in Matomo
77 * Doesn't use the DB
78 *
79 * @return array Table names
80 */
81 public function getTablesNames();
82 /**
83 * Get list of tables installed
84 *
85 * @param bool $forceReload Invalidate cache
86 * @return array installed Tables
87 */
88 public function getTablesInstalled($forceReload = \true);
89 /**
90 * Get list of installed columns in a table
91 *
92 * @param string $tableName The name of a table.
93 *
94 * @return array Installed columns indexed by the column name.
95 */
96 public function getTableColumns($tableName);
97 /**
98 * Checks whether any table exists
99 *
100 * @return bool True if tables exist; false otherwise
101 */
102 public function hasTables();
103 /**
104 * Adds a max execution time query hint into a SELECT query if $limit is bigger than 0
105 * (floating values for limit might be rounded to full seconds depending on DB support)
106 *
107 * @param string $sql query to add hint to
108 * @param float $limit time limit in seconds
109 * @return string
110 */
111 public function addMaxExecutionTimeHintToQuery(string $sql, float $limit) : string;
112 /**
113 * Returns if the database supports column updates in table updates.
114 * Some database engines are performing sanity checks for table updates. Those might include checking if all columns used
115 * already exist. In such a case queries like this might fail: `ALTER TABLE t ADD COLUMN b, ADD INDEX i (b)`
116 *
117 * @return bool
118 */
119 public function supportsComplexColumnUpdates() : bool;
120 /**
121 * Returns the default collation for a charset used by this database engine.
122 *
123 * @param string $charset
124 *
125 * @return string
126 */
127 public function getDefaultCollationForCharset(string $charset) : string;
128 /**
129 * Return the default port used by this database engine
130 *
131 * @return int
132 */
133 public function getDefaultPort() : int;
134 /**
135 * Return the table options to use for a CREATE TABLE statement.
136 *
137 * @return string
138 */
139 public function getTableCreateOptions() : string;
140 /**
141 * Returns if performing on `OPTIMIZE TABLE` is supported for InnoDb tables
142 *
143 * @return bool
144 */
145 public function isOptimizeInnoDBSupported() : bool;
146 /**
147 * Runs an `OPTIMIZE TABLE` query on the supplied table or tables.
148 *
149 * Tables will only be optimized if the `[General] enable_sql_optimize_queries` INI config option is
150 * set to **1**.
151 *
152 * @param array $tables The name of the table to optimize or an array of tables to optimize.
153 * Table names must be prefixed (see {@link Piwik\Common::prefixTable()}).
154 * @param bool $force If true, the `OPTIMIZE TABLE` query will be run even if InnoDB tables are being used.
155 * @return bool
156 */
157 public function optimizeTables(array $tables, bool $force = \false) : bool;
158 /**
159 * Returns if the database engine is able to use sorted subqueries
160 *
161 * @return bool
162 */
163 public function supportsSortingInSubquery() : bool;
164 }
165