PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / trunk
Matomo Analytics – Powerful, Privacy-First Insights for WordPress vtrunk
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 month ago Schema 2 weeks ago Adapter.php 1 month ago AdapterInterface.php 1 month ago BatchInsert.php 6 months ago Schema.php 1 month ago SchemaInterface.php 1 month 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
170 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 * Returns the type of the current database (e.g. MySQL, MariaDB, ...)
18 */
19 public function getDatabaseType() : string;
20 /**
21 * Get the SQL to create a specific Matomo table
22 *
23 * @param string $tableName
24 * @return string SQL
25 */
26 public function getTableCreateSql($tableName);
27 /**
28 * Get the SQL to create Matomo tables
29 *
30 * @return array array of strings containing SQL
31 */
32 public function getTablesCreateSql();
33 /**
34 * Creates a new table in the database.
35 *
36 * @param string $nameWithoutPrefix The name of the table without any prefix.
37 * @param string $createDefinition The table create definition
38 */
39 public function createTable($nameWithoutPrefix, $createDefinition);
40 /**
41 * Create database
42 *
43 * @param string $dbName Name of the database to create
44 */
45 public function createDatabase($dbName = null);
46 /**
47 * Drop database
48 */
49 public function dropDatabase();
50 /**
51 * Create all tables
52 */
53 public function createTables();
54 /**
55 * Creates an entry in the User table for the "anonymous" user.
56 */
57 public function createAnonymousUser();
58 /**
59 * Records the Matomo version a user used when installing this Matomo for the first time
60 */
61 public function recordInstallVersion();
62 /**
63 * Returns which Matomo version was used to install this Matomo for the first time.
64 */
65 public function getInstallVersion();
66 /**
67 * Returns the supported read isolation transaction level
68 *
69 * For example:
70 * READ COMMITTED
71 * or
72 * READ UNCOMMITTED
73 */
74 public function getSupportedReadIsolationTransactionLevel() : string;
75 /**
76 * Truncate all tables
77 */
78 public function truncateAllTables();
79 /**
80 * Names of all the prefixed tables in Matomo
81 * Doesn't use the DB
82 *
83 * @return array Table names
84 */
85 public function getTablesNames();
86 /**
87 * Get list of tables installed
88 *
89 * @param bool $forceReload Invalidate cache
90 * @return array installed Tables
91 */
92 public function getTablesInstalled($forceReload = \true);
93 /**
94 * Get list of installed columns in a table
95 *
96 * @param string $tableName The name of a table.
97 *
98 * @return array Installed columns indexed by the column name.
99 */
100 public function getTableColumns($tableName);
101 /**
102 * Checks whether any table exists
103 *
104 * @return bool True if tables exist; false otherwise
105 */
106 public function hasTables();
107 /**
108 * Adds a max execution time query hint into a SELECT query if $limit is bigger than 0
109 * (floating values for limit might be rounded to full seconds depending on DB support)
110 *
111 * @param string $sql query to add hint to
112 * @param float $limit time limit in seconds
113 */
114 public function addMaxExecutionTimeHintToQuery(string $sql, float $limit) : string;
115 /**
116 * Returns if the database supports column updates in table updates.
117 * Some database engines are performing sanity checks for table updates. Those might include checking if all columns used
118 * already exist. In such a case queries like this might fail: `ALTER TABLE t ADD COLUMN b, ADD INDEX i (b)`
119 */
120 public function supportsComplexColumnUpdates() : bool;
121 /**
122 * Returns the default collation for a charset used by this database engine.
123 */
124 public function getDefaultCollationForCharset(string $charset) : string;
125 /**
126 * Return the default port used by this database engine
127 */
128 public function getDefaultPort() : int;
129 /**
130 * Return the table options to use for a CREATE TABLE statement.
131 */
132 public function getTableCreateOptions() : string;
133 /**
134 * Returns if performing on `OPTIMIZE TABLE` is supported for InnoDb tables
135 */
136 public function isOptimizeInnoDBSupported() : bool;
137 /**
138 * Runs an `OPTIMIZE TABLE` query on the supplied table or tables.
139 *
140 * Tables will only be optimized if the `[General] enable_sql_optimize_queries` INI config option is
141 * set to **1**.
142 *
143 * @param array $tables The name of the table to optimize or an array of tables to optimize.
144 * Table names must be prefixed (see {@link Piwik\Common::prefixTable()}).
145 * @param bool $force If true, the `OPTIMIZE TABLE` query will be run even if InnoDB tables are being used.
146 */
147 public function optimizeTables(array $tables, bool $force = \false) : bool;
148 /**
149 * Returns if the database engine can provide a rollup ranking query result
150 * without needing additional sorting.
151 */
152 public function supportsRankingRollupWithoutExtraSorting() : bool;
153 /**
154 * Returns if the database engine is able to use sorted subqueries
155 */
156 public function supportsSortingInSubquery() : bool;
157 /**
158 * Returns the version of the database server
159 */
160 public function getVersion() : string;
161 /**
162 * Returns if the used database version has reached its EOL
163 */
164 public function hasReachedEOL() : bool;
165 /**
166 * Returns the minimum supported version set for the schema
167 */
168 public function getMinimumSupportedVersion() : string;
169 }
170