- Resource: MappingRule
- State
- DatabaseEntityType
- MappingRuleFilter
- SingleEntityRename
- MultiEntityRename
- EntityNameTransformation
- EntityMove
- SingleColumnChange
- MultiColumnDatatypeChange
- SourceTextFilter
- SourceNumericFilter
- NumericFilterOption
- ConditionalColumnSetValue
- ValueTransformation
- ValueListFilter
- ValuePresentInList
- IntComparisonFilter
- ValueComparison
- DoubleComparisonFilter
- AssignSpecificValue
- RoundToScale
- ApplyHash
- ConvertRowIdToColumn
- SetTablePrimaryKey
- SinglePackageChange
- SourceSqlChange
- FilterTableColumns
- Methods
Resource: MappingRule
Definition of a transformation that is to be applied to a group of entities in the source schema. Several such transformations can be applied to an entity sequentially to define the corresponding entity in the target schema.
JSON representation |
---|
{ "name": string, "displayName": string, "state": enum ( |
Fields | |
---|---|
name |
Full name of the mapping rule resource, in the form of: projects/{project}/locations/{location}/conversionWorkspaces/{set}/mappingRule/{rule}. |
displayName |
Optional. A human readable name |
state |
Optional. The mapping rule state |
ruleScope |
Required. The rule scope |
filter |
Required. The rule filter |
ruleOrder |
Required. The order in which the rule is applied. Lower order rules are applied before higher value rules so they may end up being overridden. |
revisionId |
Output only. The revision ID of the mapping rule. A new revision is committed whenever the mapping rule is changed in any way. The format is an 8-character hexadecimal string. |
revisionCreateTime |
Output only. The timestamp that the revision was created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: |
Union field details . The rule specific details. details can be only one of the following: |
|
singleEntityRename |
Optional. Rule to specify how a single entity should be renamed. |
multiEntityRename |
Optional. Rule to specify how multiple entities should be renamed. |
entityMove |
Optional. Rule to specify how multiple entities should be relocated into a different schema. |
singleColumnChange |
Optional. Rule to specify how a single column is converted. |
multiColumnDataTypeChange |
Optional. Rule to specify how multiple columns should be converted to a different data type. |
conditionalColumnSetValue |
Optional. Rule to specify how the data contained in a column should be transformed (such as trimmed, rounded, etc) provided that the data meets certain criteria. |
convertRowidColumn |
Optional. Rule to specify how multiple tables should be converted with an additional rowid column. |
setTablePrimaryKey |
Optional. Rule to specify the primary key for a table |
singlePackageChange |
Optional. Rule to specify how a single package is converted. |
sourceSqlChange |
Optional. Rule to change the sql code for an entity, for example, function, procedure. |
filterTableColumns |
Optional. Rule to specify the list of columns to include or exclude from a table. |
State
The current mapping rule state such as enabled, disabled or deleted.
Enums | |
---|---|
STATE_UNSPECIFIED |
The state of the mapping rule is unknown. |
ENABLED |
The rule is enabled. |
DISABLED |
The rule is disabled. |
DELETED |
The rule is logically deleted. |
DatabaseEntityType
The type of database entities supported,
Enums | |
---|---|
DATABASE_ENTITY_TYPE_UNSPECIFIED |
Unspecified database entity type. |
DATABASE_ENTITY_TYPE_SCHEMA |
Schema. |
DATABASE_ENTITY_TYPE_TABLE |
Table. |
DATABASE_ENTITY_TYPE_COLUMN |
Column. |
DATABASE_ENTITY_TYPE_CONSTRAINT |
Constraint. |
DATABASE_ENTITY_TYPE_INDEX |
Index. |
DATABASE_ENTITY_TYPE_TRIGGER |
Trigger. |
DATABASE_ENTITY_TYPE_VIEW |
View. |
DATABASE_ENTITY_TYPE_SEQUENCE |
Sequence. |
DATABASE_ENTITY_TYPE_STORED_PROCEDURE |
Stored Procedure. |
DATABASE_ENTITY_TYPE_FUNCTION |
Function. |
DATABASE_ENTITY_TYPE_SYNONYM |
Synonym. |
DATABASE_ENTITY_TYPE_DATABASE_PACKAGE |
Package. |
DATABASE_ENTITY_TYPE_UDT |
UDT. |
DATABASE_ENTITY_TYPE_MATERIALIZED_VIEW |
Materialized View. |
DATABASE_ENTITY_TYPE_DATABASE |
Database. |
MappingRuleFilter
A filter defining the entities that a mapping rule should be applied to. When more than one field is specified, the rule is applied only to entities which match all the fields.
JSON representation |
---|
{ "parentEntity": string, "entityNamePrefix": string, "entityNameSuffix": string, "entityNameContains": string, "entities": [ string ] } |
Fields | |
---|---|
parentEntity |
Optional. The rule should be applied to entities whose parent entity (fully qualified name) matches the given value. For example, if the rule applies to a table entity, the expected value should be a schema (schema). If the rule applies to a column or index entity, the expected value can be either a schema (schema) or a table (schema.table) |
entityNamePrefix |
Optional. The rule should be applied to entities whose non-qualified name starts with the given prefix. |
entityNameSuffix |
Optional. The rule should be applied to entities whose non-qualified name ends with the given suffix. |
entityNameContains |
Optional. The rule should be applied to entities whose non-qualified name contains the given string. |
entities[] |
Optional. The rule should be applied to specific entities defined by their fully qualified names. |
SingleEntityRename
Options to configure rule type SingleEntityRename. The rule is used to rename an entity.
The rule filter field can refer to only one entity.
The rule scope can be one of: Database, Schema, Table, Column, Constraint, Index, View, Function, Stored Procedure, Materialized View, Sequence, UDT, Synonym
JSON representation |
---|
{ "newName": string } |
Fields | |
---|---|
newName |
Required. The new name of the destination entity |
MultiEntityRename
Options to configure rule type MultiEntityRename. The rule is used to rename multiple entities.
The rule filter field can refer to one or more entities.
The rule scope can be one of: Database, Schema, Table, Column, Constraint, Index, View, Function, Stored Procedure, Materialized View, Sequence, UDT
JSON representation |
---|
{
"newNamePattern": string,
"sourceNameTransformation": enum ( |
Fields | |
---|---|
newNamePattern |
Optional. The pattern used to generate the new entity's name. This pattern must include the characters '{name}', which will be replaced with the name of the original entity. For example, the pattern 't_{name}' for an entity name jobs would be converted to 't_jobs'. If unspecified, the default value for this field is '{name}' |
sourceNameTransformation |
Optional. Additional transformation that can be done on the source entity name before it is being used by the newNamePattern, for example lower case. If no transformation is desired, use NO_TRANSFORMATION |
EntityNameTransformation
Entity Name Transformation Types
Enums | |
---|---|
ENTITY_NAME_TRANSFORMATION_UNSPECIFIED |
Entity name transformation unspecified. |
ENTITY_NAME_TRANSFORMATION_NO_TRANSFORMATION |
No transformation. |
ENTITY_NAME_TRANSFORMATION_LOWER_CASE |
Transform to lower case. |
ENTITY_NAME_TRANSFORMATION_UPPER_CASE |
Transform to upper case. |
ENTITY_NAME_TRANSFORMATION_CAPITALIZED_CASE |
Transform to capitalized case. |
EntityMove
Options to configure rule type EntityMove. The rule is used to move an entity to a new schema.
The rule filter field can refer to one or more entities.
The rule scope can be one of: Table, Column, Constraint, Index, View, Function, Stored Procedure, Materialized View, Sequence, UDT
JSON representation |
---|
{ "newSchema": string } |
Fields | |
---|---|
newSchema |
Required. The new schema |
SingleColumnChange
Options to configure rule type SingleColumnChange. The rule is used to change the properties of a column.
The rule filter field can refer to one entity.
The rule scope can be one of: Column.
When using this rule, if a field is not specified than the destination column's configuration will be the same as the one in the source column..
JSON representation |
---|
{ "dataType": string, "charset": string, "collation": string, "length": string, "precision": integer, "scale": integer, "fractionalSecondsPrecision": integer, "array": boolean, "arrayLength": integer, "nullable": boolean, "autoGenerated": boolean, "udt": boolean, "customFeatures": { object }, "setValues": [ string ], "comment": string } |
Fields | |
---|---|
dataType |
Optional. Column data type name. |
charset |
Optional. Charset override - instead of table level charset. |
collation |
Optional. Collation override - instead of table level collation. |
length |
Optional. Column length - e.g. 50 as in varchar (50) - when relevant. |
precision |
Optional. Column precision - e.g. 8 as in double (8,2) - when relevant. |
scale |
Optional. Column scale - e.g. 2 as in double (8,2) - when relevant. |
fractionalSecondsPrecision |
Optional. Column fractional seconds precision - e.g. 2 as in timestamp (2) - when relevant. |
array |
Optional. Is the column of array type. |
arrayLength |
Optional. The length of the array, only relevant if the column type is an array. |
nullable |
Optional. Is the column nullable. |
autoGenerated |
Optional. Is the column auto-generated/identity. |
udt |
Optional. Is the column a UDT (User-defined Type). |
customFeatures |
Optional. Custom engine specific features. |
setValues[] |
Optional. Specifies the list of values allowed in the column. |
comment |
Optional. Comment associated with the column. |
MultiColumnDatatypeChange
Options to configure rule type MultiColumnDatatypeChange. The rule is used to change the data type and associated properties of multiple columns at once.
The rule filter field can refer to one or more entities.
The rule scope can be one of:Column.
This rule requires additional filters to be specified beyond the basic rule filter field, which is the source data type, but the rule supports additional filtering capabilities such as the minimum and maximum field length. All additional filters which are specified are required to be met in order for the rule to be applied (logical AND between the fields).
JSON representation |
---|
{ "sourceDataTypeFilter": string, "newDataType": string, "overrideLength": string, "overrideScale": integer, "overridePrecision": integer, "overrideFractionalSecondsPrecision": integer, "customFeatures": { object }, // Union field |
Fields | |
---|---|
sourceDataTypeFilter |
Required. Filter on source data type. |
newDataType |
Required. New data type. |
overrideLength |
Optional. Column length - e.g. varchar (50) - if not specified and relevant uses the source column length. |
overrideScale |
Optional. Column scale - when relevant - if not specified and relevant uses the source column scale. |
overridePrecision |
Optional. Column precision - when relevant - if not specified and relevant uses the source column precision. |
overrideFractionalSecondsPrecision |
Optional. Column fractional seconds precision - used only for timestamp based datatypes - if not specified and relevant uses the source column fractional seconds precision. |
customFeatures |
Optional. Custom engine specific features. |
Union field source_filter . Filter on source column parameters. source_filter can be only one of the following: |
|
sourceTextFilter |
Optional. Filter for text-based data types like varchar. |
sourceNumericFilter |
Optional. Filter for fixed point number data types such as NUMERIC/NUMBER. |
SourceTextFilter
Filter for text-based data types like varchar.
JSON representation |
---|
{ "sourceMinLengthFilter": string, "sourceMaxLengthFilter": string } |
Fields | |
---|---|
sourceMinLengthFilter |
Optional. The filter will match columns with length greater than or equal to this number. |
sourceMaxLengthFilter |
Optional. The filter will match columns with length smaller than or equal to this number. |
SourceNumericFilter
Filter for fixed point number data types such as NUMERIC/NUMBER
JSON representation |
---|
{
"sourceMinScaleFilter": integer,
"sourceMaxScaleFilter": integer,
"sourceMinPrecisionFilter": integer,
"sourceMaxPrecisionFilter": integer,
"numericFilterOption": enum ( |
Fields | |
---|---|
sourceMinScaleFilter |
Optional. The filter will match columns with scale greater than or equal to this number. |
sourceMaxScaleFilter |
Optional. The filter will match columns with scale smaller than or equal to this number. |
sourceMinPrecisionFilter |
Optional. The filter will match columns with precision greater than or equal to this number. |
sourceMaxPrecisionFilter |
Optional. The filter will match columns with precision smaller than or equal to this number. |
numericFilterOption |
Required. Enum to set the option defining the datatypes numeric filter has to be applied to |
NumericFilterOption
Specifies the columns on which numeric filter needs to be applied.
Enums | |
---|---|
NUMERIC_FILTER_OPTION_UNSPECIFIED |
Numeric filter option unspecified |
NUMERIC_FILTER_OPTION_ALL |
Numeric filter option that matches all numeric columns. |
NUMERIC_FILTER_OPTION_LIMIT |
Numeric filter option that matches columns having numeric datatypes with specified precision and scale within the limited range of filter. |
NUMERIC_FILTER_OPTION_LIMITLESS |
Numeric filter option that matches only the numeric columns with no precision and scale specified. |
ConditionalColumnSetValue
Options to configure rule type ConditionalColumnSetValue. The rule is used to transform the data which is being replicated/migrated.
The rule filter field can refer to one or more entities.
The rule scope can be one of: Column.
JSON representation |
---|
{ "valueTransformation": { object ( |
Fields | |
---|---|
valueTransformation |
Required. Description of data transformation during migration. |
customFeatures |
Optional. Custom engine specific features. |
Union field
|
|
sourceTextFilter |
Optional. Optional filter on source column length. Used for text based data types like varchar. |
sourceNumericFilter |
Optional. Optional filter on source column precision and scale. Used for fixed point numbers such as NUMERIC/NUMBER data types. |
ValueTransformation
Description of data transformation during migration as part of the ConditionalColumnSetValue.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field
|
|
isNull |
Optional. Value is null |
valueList |
Optional. Value is found in the specified list. |
intComparison |
Optional. Filter on relation between source value and compare value of type integer. |
doubleComparison |
Optional. Filter on relation between source value and compare value of type double. |
Union field
|
|
assignNull |
Optional. Set to null |
assignSpecificValue |
Optional. Set to a specific value (value is converted to fit the target data type) |
assignMinValue |
Optional. Set to minValue - if integer or numeric, will use int.minvalue, etc |
assignMaxValue |
Optional. Set to maxValue - if integer or numeric, will use int.maxvalue, etc |
roundScale |
Optional. Allows the data to change scale |
applyHash |
Optional. Applies a hash function on the data |
ValueListFilter
A list of values to filter by in ConditionalColumnSetValue
JSON representation |
---|
{
"valuePresentList": enum ( |
Fields | |
---|---|
valuePresentList |
Required. Indicates whether the filter matches rows with values that are present in the list or those with values not present in it. |
values[] |
Required. The list to be used to filter by |
ignoreCase |
Required. Whether to ignore case when filtering by values. Defaults to false |
ValuePresentInList
Enum used by ValueListFilter to indicate whether the source value is in the supplied list
Enums | |
---|---|
VALUE_PRESENT_IN_LIST_UNSPECIFIED |
Value present in list unspecified |
VALUE_PRESENT_IN_LIST_IF_VALUE_LIST |
If the source value is in the supplied list at valueList |
VALUE_PRESENT_IN_LIST_IF_VALUE_NOT_LIST |
If the source value is not in the supplied list at valueList |
IntComparisonFilter
Filter based on relation between source value and compare value of type integer in ConditionalColumnSetValue
JSON representation |
---|
{
"valueComparison": enum ( |
Fields | |
---|---|
valueComparison |
Required. Relation between source value and compare value |
value |
Required. Integer compare value to be used |
ValueComparison
Enum used by IntComparisonFilter and DoubleComparisonFilter to indicate the relation between source value and compare value.
Enums | |
---|---|
VALUE_COMPARISON_UNSPECIFIED |
Value comparison unspecified. |
VALUE_COMPARISON_IF_VALUE_SMALLER_THAN |
Value is smaller than the Compare value. |
VALUE_COMPARISON_IF_VALUE_SMALLER_EQUAL_THAN |
Value is smaller or equal than the Compare value. |
VALUE_COMPARISON_IF_VALUE_LARGER_THAN |
Value is larger than the Compare value. |
VALUE_COMPARISON_IF_VALUE_LARGER_EQUAL_THAN |
Value is larger or equal than the Compare value. |
DoubleComparisonFilter
Filter based on relation between source value and compare value of type double in ConditionalColumnSetValue
JSON representation |
---|
{
"valueComparison": enum ( |
Fields | |
---|---|
valueComparison |
Required. Relation between source value and compare value |
value |
Required. Double compare value to be used |
AssignSpecificValue
Set to a specific value (value is converted to fit the target data type)
JSON representation |
---|
{ "value": string } |
Fields | |
---|---|
value |
Required. Specific value to be assigned |
RoundToScale
This allows the data to change scale, for example if the source is 2 digits after the decimal point, specify round to scale value = 2. If for example the value needs to be converted to an integer, use round to scale value = 0.
JSON representation |
---|
{ "scale": integer } |
Fields | |
---|---|
scale |
Required. Scale value to be used |
ApplyHash
Apply a hash function on the value.
JSON representation |
---|
{ // Union field |
Fields | |
---|---|
Union field
|
|
uuidFromBytes |
Optional. Generate UUID from the data's byte array |
ConvertRowIdToColumn
Options to configure rule type ConvertROWIDToColumn. The rule is used to add column rowid to destination tables based on an Oracle rowid function/property.
The rule filter field can refer to one or more entities.
The rule scope can be one of: Table.
This rule requires additional filter to be specified beyond the basic rule filter field, which is whether or not to work on tables which already have a primary key defined.
JSON representation |
---|
{ "onlyIfNoPrimaryKey": boolean } |
Fields | |
---|---|
onlyIfNoPrimaryKey |
Required. Only work on tables without primary key defined |
SetTablePrimaryKey
Options to configure rule type SetTablePrimaryKey. The rule is used to specify the columns and name to configure/alter the primary key of a table.
The rule filter field can refer to one entity.
The rule scope can be one of: Table.
JSON representation |
---|
{ "primaryKeyColumns": [ string ], "primaryKey": string } |
Fields | |
---|---|
primaryKeyColumns[] |
Required. List of column names for the primary key |
primaryKey |
Optional. Name for the primary key |
SinglePackageChange
Options to configure rule type SinglePackageChange. The rule is used to alter the sql code for a package entities.
The rule filter field can refer to one entity.
The rule scope can be: Package
JSON representation |
---|
{ "packageDescription": string, "packageBody": string } |
Fields | |
---|---|
packageDescription |
Optional. Sql code for package description |
packageBody |
Optional. Sql code for package body |
SourceSqlChange
Options to configure rule type SourceSqlChange. The rule is used to alter the sql code for database entities.
The rule filter field can refer to one entity.
The rule scope can be: StoredProcedure, Function, Trigger, View
JSON representation |
---|
{ "sqlCode": string } |
Fields | |
---|---|
sqlCode |
Required. Sql code for source (stored procedure, function, trigger or view) |
FilterTableColumns
Options to configure rule type FilterTableColumns. The rule is used to filter the list of columns to include or exclude from a table.
The rule filter field can refer to one entity.
The rule scope can be: Table
Only one of the two lists can be specified for the rule.
JSON representation |
---|
{ "includeColumns": [ string ], "excludeColumns": [ string ] } |
Fields | |
---|---|
includeColumns[] |
Optional. List of columns to be included for a particular table. |
excludeColumns[] |
Optional. List of columns to be excluded for a particular table. |
Methods |
|
---|---|
|
Creates a new mapping rule for a given conversion workspace. |
|
Deletes a single mapping rule. |
|
Gets the details of a mapping rule. |
|
Imports the mapping rules for a given conversion workspace. |
|
Lists the mapping rules for a specific conversion workspace. |