_connection = $connection; } /** * Get the list of tables, excluding any views, available in the current connection. * * @return array The list of tables in the connected database/schema. */ public function listTablesWithoutViews(): array { return $this->getDialect()->listTablesWithoutViews(); } /** * Get the list of tables and views available in the current connection. * * @return array The list of tables and views in the connected database/schema. */ public function listTables(): array { return $this->getDialect()->listTables(); } /** * Get the column metadata for a table. * * The name can include a database schema name in the form 'schema.table'. * * @param string $name The name of the table to describe. * @param array $options Unused * @return \Cake\Database\Schema\TableSchemaInterface Object with column metadata. * @throws \Cake\Database\Exception\DatabaseException when table cannot be described. */ public function describe(string $name, array $options = []): TableSchemaInterface { return $this->getDialect()->describe($name); } /** * Setups the schema dialect to be used for this collection. * * @return \Cake\Database\Schema\SchemaDialect */ protected function getDialect(): SchemaDialect { return $this->_dialect ??= $this->_connection->getWriteDriver()->schemaDialect(); } }