# Schema

> Schema is the class for retrieving metadata from an Oracle database.

[API reference](/docs/api/index.md) › [yii](/docs/api/yii/index.md) › [db](/docs/api/yii/db/index.md) › [oci](/docs/api/yii/db/oci/index.md) › Schema

| class | `yii\db\oci\Schema` |
| --- | --- |
| Extends | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) » [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| Implements | [`yii\db\ConstraintFinderInterface`](/docs/api/yii/db/constraintfinderinterface/index.md), [`yii\base\Configurable`](/docs/api/yii/base/configurable/index.md) |
| Uses traits | [`yii\db\ConstraintFinderTrait`](/docs/api/yii/db/constraintfindertrait/index.md) |
| Since | 2.0 |
| Source | [`framework/db/oci/Schema.php`](https://github.com/yiisoft/yii2/blob/22.0/framework/db/oci/Schema.php#L42) |

Schema is the class for retrieving metadata from an Oracle database.

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-columnSchemaClass"></span>`$columnSchemaClass` | `class-string<yii\db\T>\|array{class?: class-string<yii\db\T>, __class?: class-string<yii\db\T>}` | Default: `\yii\db\oci\ColumnSchema::class`. Available since 2.0.11. | `Schema` |
| <span id="property-db"></span>[`$db`](/docs/api/yii/db/schema/index.md#property-db) | [`yii\db\Connection`](/docs/api/yii/db/connection/index.md) | The database connection Default: `null`. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="property-defaultSchema"></span>[`$defaultSchema`](/docs/api/yii/db/schema/index.md#property-defaultSchema) | `string` | The default schema name used for the current session. Default: `null`. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="property-exceptionMap"></span>`$exceptionMap` | `array` | Map of DB errors and corresponding exceptions If left part is found in DB error message exception class from the right part is used. Default: `['ORA-00001: unique constraint' => \yii\db\IntegrityException::class]`. | `Schema` |
| <span id="property-lastInsertID"></span>`$lastInsertID` read-only | `string` | The row ID of the last row inserted, or the last value retrieved from the sequence object. | `Schema` |
| <span id="property-queryBuilder"></span>[`$queryBuilder`](/docs/api/yii/db/schema/index.md#property-queryBuilder) read-only | `yii\db\TQueryBuilder` | The query builder for this connection. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="property-schemaChecks"></span>[`$schemaChecks`](/docs/api/yii/db/constraintfindertrait/index.md#property-schemaChecks) read-only | [`yii\db\CheckConstraint`](/docs/api/yii/db/checkconstraint/index.md)`[][]` | Check constraints for all tables in the database. | [`yii\db\ConstraintFinderTrait`](/docs/api/yii/db/constraintfindertrait/index.md) |
| <span id="property-schemaDefaultValues"></span>[`$schemaDefaultValues`](/docs/api/yii/db/constraintfindertrait/index.md#property-schemaDefaultValues) read-only | [`yii\db\DefaultValueConstraint`](/docs/api/yii/db/defaultvalueconstraint/index.md)`[]` | Default value constraints for all tables in the database. | [`yii\db\ConstraintFinderTrait`](/docs/api/yii/db/constraintfindertrait/index.md) |
| <span id="property-schemaForeignKeys"></span>[`$schemaForeignKeys`](/docs/api/yii/db/constraintfindertrait/index.md#property-schemaForeignKeys) read-only | [`yii\db\ForeignKeyConstraint`](/docs/api/yii/db/foreignkeyconstraint/index.md)`[][]` | Foreign keys for all tables in the database. | [`yii\db\ConstraintFinderTrait`](/docs/api/yii/db/constraintfindertrait/index.md) |
| <span id="property-schemaIndexes"></span>[`$schemaIndexes`](/docs/api/yii/db/constraintfindertrait/index.md#property-schemaIndexes) read-only | [`yii\db\IndexConstraint`](/docs/api/yii/db/indexconstraint/index.md)`[][]` | Indexes for all tables in the database. | [`yii\db\ConstraintFinderTrait`](/docs/api/yii/db/constraintfindertrait/index.md) |
| <span id="property-schemaNames"></span>[`$schemaNames`](/docs/api/yii/db/schema/index.md#property-schemaNames) read-only | `string[]` | All schema names in the database, except system schemas. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="property-schemaPrimaryKeys"></span>[`$schemaPrimaryKeys`](/docs/api/yii/db/constraintfindertrait/index.md#property-schemaPrimaryKeys) read-only | [`yii\db\Constraint`](/docs/api/yii/db/constraint/index.md)`[]` | Primary keys for all tables in the database. | [`yii\db\ConstraintFinderTrait`](/docs/api/yii/db/constraintfindertrait/index.md) |
| <span id="property-schemaUniques"></span>[`$schemaUniques`](/docs/api/yii/db/constraintfindertrait/index.md#property-schemaUniques) read-only | [`yii\db\IndexConstraint`](/docs/api/yii/db/indexconstraint/index.md)`[][]` | Unique constraints for all tables in the database. | [`yii\db\ConstraintFinderTrait`](/docs/api/yii/db/constraintfindertrait/index.md) |
| <span id="property-serverVersion"></span>[`$serverVersion`](/docs/api/yii/db/schema/index.md#property-serverVersion) read-only | `string` | Server version as a string. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="property-systemSchemaNames"></span>[`$systemSchemaNames`](/docs/api/yii/db/schema/index.md#property-systemSchemaNames) | `list<string>` | List of schema names that should be excluded from [`getSchemaNames()`](/docs/api/yii/db/schema/index.md#method-getSchemaNames). Default: `[]`. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="property-tableNames"></span>[`$tableNames`](/docs/api/yii/db/schema/index.md#property-tableNames) read-only | `string[]` | All table names in the database. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="property-tableSchemas"></span>[`$tableSchemas`](/docs/api/yii/db/schema/index.md#property-tableSchemas) read-only | [`yii\db\TableSchema`](/docs/api/yii/db/tableschema/index.md)`[]` | The metadata for all tables in the database. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="property-transactionIsolationLevel"></span>[`$transactionIsolationLevel`](/docs/api/yii/db/schema/index.md#property-transactionIsolationLevel) write-only | `string` | The transaction isolation level to use for this transaction. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="property-columnQuoteCharacter"></span>[`$columnQuoteCharacter`](/docs/api/yii/db/schema/index.md#property-columnQuoteCharacter) protected | `string\|string[]` | Character used to quote column names. Default: `'"'`. Available since 2.0.14. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| [`$tableQuoteCharacter`](#property-tableQuoteCharacter) protected | `string\|string[]` | Default: `'"'`. Available since 2.0.14. | `Schema` |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| <span id="method-__construct"></span>[`__construct()`](/docs/api/yii/base/baseobject/index.md#method-__construct) | Constructor. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__call"></span>[`__call()`](/docs/api/yii/base/baseobject/index.md#method-__call) | Calls the named method which is not a class method. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__get"></span>[`__get()`](/docs/api/yii/base/baseobject/index.md#method-__get) | Returns the value of an object property. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__isset"></span>[`__isset()`](/docs/api/yii/base/baseobject/index.md#method-__isset) | Checks if a property is set, i.e. defined and not null. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__set"></span>[`__set()`](/docs/api/yii/base/baseobject/index.md#method-__set) | Sets value of an object property. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__unset"></span>[`__unset()`](/docs/api/yii/base/baseobject/index.md#method-__unset) | Sets an object property to null. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-canGetProperty"></span>[`canGetProperty()`](/docs/api/yii/base/baseobject/index.md#method-canGetProperty) | Returns a value indicating whether a property can be read. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-canSetProperty"></span>[`canSetProperty()`](/docs/api/yii/base/baseobject/index.md#method-canSetProperty) | Returns a value indicating whether a property can be set. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-className"></span>[`className()`](/docs/api/yii/base/baseobject/index.md#method-className) static | Returns the fully qualified name of this class. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-convertException"></span>[`convertException()`](/docs/api/yii/db/schema/index.md#method-convertException) | Converts a DB exception to a more concrete one if possible. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| [`createColumnSchemaBuilder()`](#method-createColumnSchemaBuilder) | Create a column schema builder instance giving the type and value precision. | `Schema` |
| [`createQueryBuilder()`](#method-createQueryBuilder) | Creates a query builder for the database. | `Schema` |
| <span id="method-createSavepoint"></span>[`createSavepoint()`](/docs/api/yii/db/schema/index.md#method-createSavepoint) | Creates a new savepoint. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| [`findUniqueIndexes()`](#method-findUniqueIndexes) | Returns all unique indexes for the given table. | `Schema` |
| [`getLastInsertID()`](#method-getLastInsertID) |  | `Schema` |
| <span id="method-getPdoType"></span>[`getPdoType()`](/docs/api/yii/db/schema/index.md#method-getPdoType) | Determines the PDO type for the given PHP data value. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-getQueryBuilder"></span>[`getQueryBuilder()`](/docs/api/yii/db/schema/index.md#method-getQueryBuilder) |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-getRawTableName"></span>[`getRawTableName()`](/docs/api/yii/db/schema/index.md#method-getRawTableName) | Returns the actual name of a given table name. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-getSchemaChecks"></span>[`getSchemaChecks()`](/docs/api/yii/db/constraintfindertrait/index.md#method-getSchemaChecks) | Returns check constraints for all tables in the database. | [`yii\db\ConstraintFinderTrait`](/docs/api/yii/db/constraintfindertrait/index.md) |
| <span id="method-getSchemaDefaultValues"></span>[`getSchemaDefaultValues()`](/docs/api/yii/db/constraintfindertrait/index.md#method-getSchemaDefaultValues) | Returns default value constraints for all tables in the database. | [`yii\db\ConstraintFinderTrait`](/docs/api/yii/db/constraintfindertrait/index.md) |
| <span id="method-getSchemaForeignKeys"></span>[`getSchemaForeignKeys()`](/docs/api/yii/db/constraintfindertrait/index.md#method-getSchemaForeignKeys) | Returns foreign keys for all tables in the database. | [`yii\db\ConstraintFinderTrait`](/docs/api/yii/db/constraintfindertrait/index.md) |
| <span id="method-getSchemaIndexes"></span>[`getSchemaIndexes()`](/docs/api/yii/db/constraintfindertrait/index.md#method-getSchemaIndexes) | Returns indexes for all tables in the database. | [`yii\db\ConstraintFinderTrait`](/docs/api/yii/db/constraintfindertrait/index.md) |
| <span id="method-getSchemaNames"></span>[`getSchemaNames()`](/docs/api/yii/db/schema/index.md#method-getSchemaNames) | Returns all schema names in the database, except system schemas. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-getSchemaPrimaryKeys"></span>[`getSchemaPrimaryKeys()`](/docs/api/yii/db/constraintfindertrait/index.md#method-getSchemaPrimaryKeys) | Returns primary keys for all tables in the database. | [`yii\db\ConstraintFinderTrait`](/docs/api/yii/db/constraintfindertrait/index.md) |
| <span id="method-getSchemaUniques"></span>[`getSchemaUniques()`](/docs/api/yii/db/constraintfindertrait/index.md#method-getSchemaUniques) | Returns unique constraints for all tables in the database. | [`yii\db\ConstraintFinderTrait`](/docs/api/yii/db/constraintfindertrait/index.md) |
| <span id="method-getServerVersion"></span>[`getServerVersion()`](/docs/api/yii/db/schema/index.md#method-getServerVersion) | Returns a server version as a string comparable by [`version_compare()`](https://www.php.net/manual/en/function.version-compare.php). | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-getTableChecks"></span>[`getTableChecks()`](/docs/api/yii/db/constraintfindertrait/index.md#method-getTableChecks) | Obtains the check constraints information for the named table. | [`yii\db\ConstraintFinderTrait`](/docs/api/yii/db/constraintfindertrait/index.md) |
| <span id="method-getTableDefaultValues"></span>[`getTableDefaultValues()`](/docs/api/yii/db/constraintfindertrait/index.md#method-getTableDefaultValues) | Obtains the default value constraints information for the named table. | [`yii\db\ConstraintFinderTrait`](/docs/api/yii/db/constraintfindertrait/index.md) |
| <span id="method-getTableForeignKeys"></span>[`getTableForeignKeys()`](/docs/api/yii/db/constraintfindertrait/index.md#method-getTableForeignKeys) | Obtains the foreign keys information for the named table. | [`yii\db\ConstraintFinderTrait`](/docs/api/yii/db/constraintfindertrait/index.md) |
| <span id="method-getTableIndexes"></span>[`getTableIndexes()`](/docs/api/yii/db/constraintfindertrait/index.md#method-getTableIndexes) | Obtains the indexes information for the named table. | [`yii\db\ConstraintFinderTrait`](/docs/api/yii/db/constraintfindertrait/index.md) |
| <span id="method-getTableNames"></span>[`getTableNames()`](/docs/api/yii/db/schema/index.md#method-getTableNames) | Returns all table names in the database. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-getTablePrimaryKey"></span>[`getTablePrimaryKey()`](/docs/api/yii/db/constraintfindertrait/index.md#method-getTablePrimaryKey) | Obtains the primary key for the named table. | [`yii\db\ConstraintFinderTrait`](/docs/api/yii/db/constraintfindertrait/index.md) |
| <span id="method-getTableSchema"></span>[`getTableSchema()`](/docs/api/yii/db/schema/index.md#method-getTableSchema) | Obtains the metadata for the named table. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-getTableSchemas"></span>[`getTableSchemas()`](/docs/api/yii/db/schema/index.md#method-getTableSchemas) | Returns the metadata for all tables in the database. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-getTableUniques"></span>[`getTableUniques()`](/docs/api/yii/db/constraintfindertrait/index.md#method-getTableUniques) | Obtains the unique constraints information for the named table. | [`yii\db\ConstraintFinderTrait`](/docs/api/yii/db/constraintfindertrait/index.md) |
| <span id="method-hasMethod"></span>[`hasMethod()`](/docs/api/yii/base/baseobject/index.md#method-hasMethod) | Returns a value indicating whether a method is defined. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-hasProperty"></span>[`hasProperty()`](/docs/api/yii/base/baseobject/index.md#method-hasProperty) | Returns a value indicating whether a property is defined. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| [`init()`](#method-init) | Initializes the object. | `Schema` |
| [`insert()`](#method-insert) | Executes the INSERT command, returning primary key values. | `Schema` |
| <span id="method-isReadQuery"></span>[`isReadQuery()`](/docs/api/yii/db/schema/index.md#method-isReadQuery) | Returns a value indicating whether a SQL statement is for read purpose. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-quoteColumnName"></span>[`quoteColumnName()`](/docs/api/yii/db/schema/index.md#method-quoteColumnName) | Quotes a column name for use in a query. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-quoteSimpleColumnName"></span>[`quoteSimpleColumnName()`](/docs/api/yii/db/schema/index.md#method-quoteSimpleColumnName) | Quotes a simple column name for use in a query. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-quoteSimpleTableName"></span>[`quoteSimpleTableName()`](/docs/api/yii/db/schema/index.md#method-quoteSimpleTableName) | Quotes a simple table name for use in a query. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-quoteTableName"></span>[`quoteTableName()`](/docs/api/yii/db/schema/index.md#method-quoteTableName) | Quotes a table name for use in a query. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-quoteValue"></span>[`quoteValue()`](/docs/api/yii/db/schema/index.md#method-quoteValue) | Quotes a string value for use in a query. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-refresh"></span>[`refresh()`](/docs/api/yii/db/schema/index.md#method-refresh) | Refreshes the schema. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-refreshTableSchema"></span>[`refreshTableSchema()`](/docs/api/yii/db/schema/index.md#method-refreshTableSchema) | Refreshes the particular table schema. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| [`releaseSavepoint()`](#method-releaseSavepoint) | Releases an existing savepoint. | `Schema` |
| <span id="method-resolveRawTableName"></span>[`resolveRawTableName()`](/docs/api/yii/db/schema/index.md#method-resolveRawTableName) | Resolves the table name and schema name (if any) without loading database metadata. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-rollBackSavepoint"></span>[`rollBackSavepoint()`](/docs/api/yii/db/schema/index.md#method-rollBackSavepoint) | Rolls back to a previously created savepoint. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-setTransactionIsolationLevel"></span>[`setTransactionIsolationLevel()`](/docs/api/yii/db/schema/index.md#method-setTransactionIsolationLevel) | Sets the isolation level of the current transaction. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-supportsSavepoint"></span>[`supportsSavepoint()`](/docs/api/yii/db/schema/index.md#method-supportsSavepoint) |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-unquoteSimpleColumnName"></span>[`unquoteSimpleColumnName()`](/docs/api/yii/db/schema/index.md#method-unquoteSimpleColumnName) | Unquotes a simple column name. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-unquoteSimpleTableName"></span>[`unquoteSimpleTableName()`](/docs/api/yii/db/schema/index.md#method-unquoteSimpleTableName) | Unquotes a simple table name. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| [`createColumn()`](#method-createColumn) protected | Creates ColumnSchema instance. | `Schema` |
| <span id="method-createColumnSchema"></span>[`createColumnSchema()`](/docs/api/yii/db/schema/index.md#method-createColumnSchema) protected | Creates a column schema for the database. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| [`extractColumnSize()`](#method-extractColumnSize) protected | Extracts size, precision and scale information from column's DB type. | `Schema` |
| [`extractColumnType()`](#method-extractColumnType) protected | Extracts the data types for the given column. | `Schema` |
| [`findColumns()`](#method-findColumns) protected | Collects the table column metadata. | `Schema` |
| [`findConstraints()`](#method-findConstraints) protected | Finds constraints and fills them into TableSchema object passed. | `Schema` |
| [`findSchemaNames()`](#method-findSchemaNames) protected | Returns all schema names in the database, including the default one but not system schemas. | `Schema` |
| [`findTableNames()`](#method-findTableNames) protected | Returns all table names in the database. | `Schema` |
| <span id="method-getCacheKey"></span>[`getCacheKey()`](/docs/api/yii/db/schema/index.md#method-getCacheKey) protected | Returns the cache key for the specified table name. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-getCacheTag"></span>[`getCacheTag()`](/docs/api/yii/db/schema/index.md#method-getCacheTag) protected | Returns the cache tag name. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-getColumnPhpType"></span>[`getColumnPhpType()`](/docs/api/yii/db/schema/index.md#method-getColumnPhpType) protected | Extracts the PHP type from abstract DB type. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-getSchemaMetadata"></span>[`getSchemaMetadata()`](/docs/api/yii/db/schema/index.md#method-getSchemaMetadata) protected | Returns the metadata of the given type for all tables in the given schema. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-getTableMetadata"></span>[`getTableMetadata()`](/docs/api/yii/db/schema/index.md#method-getTableMetadata) protected | Returns the metadata of the given type for the given table. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="method-getTableNameParts"></span>[`getTableNameParts()`](/docs/api/yii/db/schema/index.md#method-getTableNameParts) protected | Splits full table name into parts. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| [`getTableSequenceName()`](#method-getTableSequenceName) protected | Sequence name of table. | `Schema` |
| [`loadTableChecks()`](#method-loadTableChecks) protected |  | `Schema` |
| [`loadTableDefaultValues()`](#method-loadTableDefaultValues) protected |  | `Schema` |
| [`loadTableForeignKeys()`](#method-loadTableForeignKeys) protected |  | `Schema` |
| [`loadTableIndexes()`](#method-loadTableIndexes) protected |  | `Schema` |
| [`loadTablePrimaryKey()`](#method-loadTablePrimaryKey) protected |  | `Schema` |
| [`loadTableSchema()`](#method-loadTableSchema) protected | Loads the metadata for the specified table. | `Schema` |
| [`loadTableUniques()`](#method-loadTableUniques) protected |  | `Schema` |
| <span id="method-normalizePdoRowKeyCase"></span>[`normalizePdoRowKeyCase()`](/docs/api/yii/db/schema/index.md#method-normalizePdoRowKeyCase) protected | Changes row's array key case to lower if PDO's one is set to uppercase. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| [`resolveTableName()`](#method-resolveTableName) protected | Resolves the table name and schema name (if any). | `Schema` |
| <span id="method-setTableMetadata"></span>[`setTableMetadata()`](/docs/api/yii/db/schema/index.md#method-setTableMetadata) protected | Sets the metadata of the given type for the given table. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |

## Constants

| Constant | Value | Description | Defined by |
| --- | --- | --- | --- |
| <span id="const-TYPE_PK"></span>[`TYPE_PK`](/docs/api/yii/db/schema/index.md#const-TYPE_PK) | `'pk'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_UPK"></span>[`TYPE_UPK`](/docs/api/yii/db/schema/index.md#const-TYPE_UPK) | `'upk'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_BIGPK"></span>[`TYPE_BIGPK`](/docs/api/yii/db/schema/index.md#const-TYPE_BIGPK) | `'bigpk'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_UBIGPK"></span>[`TYPE_UBIGPK`](/docs/api/yii/db/schema/index.md#const-TYPE_UBIGPK) | `'ubigpk'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_CHAR"></span>[`TYPE_CHAR`](/docs/api/yii/db/schema/index.md#const-TYPE_CHAR) | `'char'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_STRING"></span>[`TYPE_STRING`](/docs/api/yii/db/schema/index.md#const-TYPE_STRING) | `'string'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_TEXT"></span>[`TYPE_TEXT`](/docs/api/yii/db/schema/index.md#const-TYPE_TEXT) | `'text'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_TINYINT"></span>[`TYPE_TINYINT`](/docs/api/yii/db/schema/index.md#const-TYPE_TINYINT) | `'tinyint'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_SMALLINT"></span>[`TYPE_SMALLINT`](/docs/api/yii/db/schema/index.md#const-TYPE_SMALLINT) | `'smallint'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_INTEGER"></span>[`TYPE_INTEGER`](/docs/api/yii/db/schema/index.md#const-TYPE_INTEGER) | `'integer'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_BIGINT"></span>[`TYPE_BIGINT`](/docs/api/yii/db/schema/index.md#const-TYPE_BIGINT) | `'bigint'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_FLOAT"></span>[`TYPE_FLOAT`](/docs/api/yii/db/schema/index.md#const-TYPE_FLOAT) | `'float'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_DOUBLE"></span>[`TYPE_DOUBLE`](/docs/api/yii/db/schema/index.md#const-TYPE_DOUBLE) | `'double'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_DECIMAL"></span>[`TYPE_DECIMAL`](/docs/api/yii/db/schema/index.md#const-TYPE_DECIMAL) | `'decimal'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_DATETIME"></span>[`TYPE_DATETIME`](/docs/api/yii/db/schema/index.md#const-TYPE_DATETIME) | `'datetime'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_TIMESTAMP"></span>[`TYPE_TIMESTAMP`](/docs/api/yii/db/schema/index.md#const-TYPE_TIMESTAMP) | `'timestamp'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_TIME"></span>[`TYPE_TIME`](/docs/api/yii/db/schema/index.md#const-TYPE_TIME) | `'time'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_DATE"></span>[`TYPE_DATE`](/docs/api/yii/db/schema/index.md#const-TYPE_DATE) | `'date'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_BINARY"></span>[`TYPE_BINARY`](/docs/api/yii/db/schema/index.md#const-TYPE_BINARY) | `'binary'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_BOOLEAN"></span>[`TYPE_BOOLEAN`](/docs/api/yii/db/schema/index.md#const-TYPE_BOOLEAN) | `'boolean'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_MONEY"></span>[`TYPE_MONEY`](/docs/api/yii/db/schema/index.md#const-TYPE_MONEY) | `'money'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-TYPE_JSON"></span>[`TYPE_JSON`](/docs/api/yii/db/schema/index.md#const-TYPE_JSON) | `'json'` |  | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |
| <span id="const-SCHEMA_CACHE_VERSION"></span>[`SCHEMA_CACHE_VERSION`](/docs/api/yii/db/schema/index.md#const-SCHEMA_CACHE_VERSION) | `1` | Schema cache version, to detect incompatibilities in cached values when the data format of the cache changes. | [`yii\db\Schema`](/docs/api/yii/db/schema/index.md) |

## Property details

### $tableQuoteCharacter <span id="property-tableQuoteCharacter"></span>

```php
protected string|string[] $tableQuoteCharacter = '"'
```

An array of 2 characters can be used in case starting and ending characters are different.

**Since**

2.0.14

## Method details

### createColumnSchemaBuilder() <span id="method-createColumnSchemaBuilder"></span>

```php
public function createColumnSchemaBuilder(mixed $type, mixed $length = null): yii\db\ColumnSchemaBuilder
```

Create a column schema builder instance giving the type and value precision.

This method may be overridden by child classes to create a DBMS-specific column schema builder.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$type` | `mixed` | Type of the column. See [`ColumnSchemaBuilder::$type`](/docs/api/yii/db/columnschemabuilder/index.md#property-type). |
| `$length` | `mixed` | Length or precision of the column. See [`ColumnSchemaBuilder::$length`](/docs/api/yii/db/columnschemabuilder/index.md#property-length). |

**Returns**

[`yii\db\ColumnSchemaBuilder`](/docs/api/yii/db/columnschemabuilder/index.md): Column schema builder instance

**Since**

2.0.6

### createQueryBuilder() <span id="method-createQueryBuilder"></span>

```php
public function createQueryBuilder(): yii\db\TQueryBuilder
```

Creates a query builder for the database.

This method may be overridden by child classes to create a DBMS-specific query builder.

**Returns**

`yii\db\TQueryBuilder`: Query builder instance

### findUniqueIndexes() <span id="method-findUniqueIndexes"></span>

```php
public function findUniqueIndexes(yii\db\TableSchema $table): array
```

Returns all unique indexes for the given table.

Each array element is of the following structure:

```
[
    'IndexName1' => ['col1' [, ...]],
    'IndexName2' => ['col2' [, ...]],
]
```

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$table` | [`yii\db\TableSchema`](/docs/api/yii/db/tableschema/index.md) | The table metadata. |

**Returns**

`array`: All unique indexes for the given table.

**Since**

2.0.4

### getLastInsertID() <span id="method-getLastInsertID"></span>

```php
public function getLastInsertID(string $sequenceName = ''): string
```

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$sequenceName` | `string` | Name of the sequence object (required by some DBMS) |

**Returns**

`string`: The row ID of the last row inserted, or the last value retrieved from the sequence object

**Throws**

- [`yii\base\InvalidCallException`](/docs/api/yii/base/invalidcallexception/index.md): if the DB connection is not active

**See also**

- <https://www.php.net/manual/en/function.PDO-lastInsertId.php> (-> Oracle does not support this Returns the ID of the last inserted row or sequence value.)

### init() <span id="method-init"></span>

```php
public function init(): mixed
```

Initializes the object.

This method is invoked at the end of the constructor after the object is initialized with the
given configuration.

**Returns**

`mixed`

### insert() <span id="method-insert"></span>

```php
public function insert(mixed $table, mixed $columns): array|false
```

Executes the INSERT command, returning primary key values.

Merges primary-key and `BLOB` locator entries into one Oracle `RETURNING` clause.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$table` | `mixed` | The table that new rows will be inserted into. |
| `$columns` | `mixed` | The column data (name => value) to be inserted into the table. |

**Returns**

`array|false`: Primary key values or false if the command fails

**Since**

2.0.4

### releaseSavepoint() <span id="method-releaseSavepoint"></span>

```php
public function releaseSavepoint(mixed $name): mixed
```

Releases an existing savepoint.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$name` | `mixed` | The savepoint name |

**Returns**

`mixed`

### createColumn() <span id="method-createColumn"></span>

```php
protected function createColumn(array $column): yii\db\oci\T
```

Creates ColumnSchema instance.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$column` | `array` |  |

**Returns**

`yii\db\oci\T`

### extractColumnSize() <span id="method-extractColumnSize"></span>

```php
protected function extractColumnSize(yii\db\oci\ColumnSchema $column, string $dbType, string $precision, string $scale, string $length): mixed
```

Extracts size, precision and scale information from column's DB type.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$column` | [`ColumnSchema`](/docs/api/yii/db/oci/columnschema/index.md) |  |
| `$dbType` | `string` | The column's DB type |
| `$precision` | `string` | Total number of digits. This parameter is available since version 2.0.4. |
| `$scale` | `string` | Number of digits on the right of the decimal separator. This parameter is available since version 2.0.4. |
| `$length` | `string` | Length for character types. This parameter is available since version 2.0.4. |

**Returns**

`mixed`

### extractColumnType() <span id="method-extractColumnType"></span>

```php
protected function extractColumnType(yii\db\oci\ColumnSchema $column, string $dbType, string $precision, string $scale, string $length): mixed
```

Extracts the data types for the given column.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$column` | [`ColumnSchema`](/docs/api/yii/db/oci/columnschema/index.md) |  |
| `$dbType` | `string` | DB type |
| `$precision` | `string` | Total number of digits. This parameter is available since version 2.0.4. |
| `$scale` | `string` | Number of digits on the right of the decimal separator. This parameter is available since version 2.0.4. |
| `$length` | `string` | Length for character types. This parameter is available since version 2.0.4. |

**Returns**

`mixed`

### findColumns() <span id="method-findColumns"></span>

```php
protected function findColumns(yii\db\TableSchema $table): bool
```

Collects the table column metadata.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$table` | [`yii\db\TableSchema`](/docs/api/yii/db/tableschema/index.md) | The table schema. |

**Returns**

`bool`: Whether the table exists.

### findConstraints() <span id="method-findConstraints"></span>

```php
protected function findConstraints(yii\db\TableSchema $table): mixed
```

Finds constraints and fills them into TableSchema object passed.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$table` | [`yii\db\TableSchema`](/docs/api/yii/db/tableschema/index.md) |  |

**Returns**

`mixed`

### findSchemaNames() <span id="method-findSchemaNames"></span>

```php
protected function findSchemaNames(): array
```

Returns all schema names in the database, including the default one but not system schemas.

This method should be overridden by child classes in order to support this feature
because the default implementation simply throws an exception.

**Returns**

`array`: All schema names in the database, except system schemas.

**Throws**

- [`yii\base\NotSupportedException`](/docs/api/yii/base/notsupportedexception/index.md): if this method is not supported by the DBMS.

**Since**

2.0.4

**See also**

- <https://docs.oracle.com/cd/B28359_01/server.111/b28337/tdpsg_user_accounts.htm>

### findTableNames() <span id="method-findTableNames"></span>

```php
protected function findTableNames(mixed $schema = ''): array
```

Returns all table names in the database.

This method should be overridden by child classes in order to support this feature
because the default implementation simply throws an exception.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$schema` | `mixed` | The schema of the tables. Defaults to empty string, meaning the current or default schema. |

**Returns**

`array`: All table names in the database. The names have NO schema name prefix.

**Throws**

- [`yii\base\NotSupportedException`](/docs/api/yii/base/notsupportedexception/index.md): if this method is not supported by the DBMS.

### getTableSequenceName() <span id="method-getTableSequenceName"></span>

```php
protected function getTableSequenceName(string $tableName): string|null
```

Sequence name of table.

Resolves the sequence backing the table's primary key, supporting two storage idioms:

- `IDENTITY` columns (Oracle `12.1+`): returns the system-generated `ISEQ$$_*` sequence from
  `USER_TAB_IDENTITY_COLS`. Surfaced so framework machinery that reads `\yii\db\TableSchema::$sequenceName`
  (notably `\yii\test\ActiveFixture::resetTable()`) continues to work for tables created with `Schema::TYPE_PK`.
- Legacy trigger + sequence pairs (pre-`22.0`): falls back to the `USER_DEPENDENCIES` / `USER_TRIGGERS` join so
  applications that have not yet migrated their tables continue to expose the user-named sequence.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$tableName` | `string` | Table name. |

**Returns**

`string|null`: Whether the sequence exists.

### loadTableChecks() <span id="method-loadTableChecks"></span>

```php
protected function loadTableChecks(mixed $tableName)
```

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$tableName` | `mixed` |  |

### loadTableDefaultValues() <span id="method-loadTableDefaultValues"></span>

```php
protected function loadTableDefaultValues(mixed $tableName)
```

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$tableName` | `mixed` |  |

**Throws**

- [`yii\base\NotSupportedException`](/docs/api/yii/base/notsupportedexception/index.md): if this method is called.

### loadTableForeignKeys() <span id="method-loadTableForeignKeys"></span>

```php
protected function loadTableForeignKeys(mixed $tableName)
```

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$tableName` | `mixed` |  |

### loadTableIndexes() <span id="method-loadTableIndexes"></span>

```php
protected function loadTableIndexes(mixed $tableName)
```

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$tableName` | `mixed` |  |

### loadTablePrimaryKey() <span id="method-loadTablePrimaryKey"></span>

```php
protected function loadTablePrimaryKey(mixed $tableName)
```

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$tableName` | `mixed` |  |

### loadTableSchema() <span id="method-loadTableSchema"></span>

```php
protected function loadTableSchema(mixed $name): yii\db\TableSchema|null
```

Loads the metadata for the specified table.

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$name` | `mixed` | Table name |

**Returns**

[`yii\db\TableSchema`](/docs/api/yii/db/tableschema/index.md)`|null`: DBMS-dependent table metadata, `null` if the table does not exist.

### loadTableUniques() <span id="method-loadTableUniques"></span>

```php
protected function loadTableUniques(mixed $tableName)
```

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$tableName` | `mixed` |  |

### resolveTableName() <span id="method-resolveTableName"></span>

```php
protected function resolveTableName(mixed $name): yii\db\TableSchema
```

Resolves the table name and schema name (if any).

**Parameters**

| Parameter | Type | Description |
| --- | --- | --- |
| `$name` | `mixed` | The table name |

**Returns**

[`yii\db\TableSchema`](/docs/api/yii/db/tableschema/index.md): [`TableSchema`](/docs/api/yii/db/tableschema/index.md) with resolved table, schema, etc. names.

**Throws**

- [`yii\base\NotSupportedException`](/docs/api/yii/base/notsupportedexception/index.md): if this method is not supported by the DBMS.

**Since**

2.0.13