Documentation ¶
Overview ¶
Package oracle handles schema and data migrations from oracle.
Index ¶
- Variables
- func ProcessDataRow(conv *internal.Conv, tableId string, colIds []string, srcSchema schema.Table, ...)
- type InfoSchemaImpl
- func (isi InfoSchemaImpl) GetColumns(conv *internal.Conv, table common.SchemaAndName, ...) (map[string]schema.Column, []string, error)
- func (isi InfoSchemaImpl) GetConstraints(conv *internal.Conv, table common.SchemaAndName) ([]string, map[string][]string, error)
- func (isi InfoSchemaImpl) GetForeignKeys(conv *internal.Conv, table common.SchemaAndName) (foreignKeys []schema.ForeignKey, err error)
- func (isi InfoSchemaImpl) GetIndexes(conv *internal.Conv, table common.SchemaAndName, ...) ([]schema.Index, error)
- func (isi InfoSchemaImpl) GetRowCount(table common.SchemaAndName) (int64, error)
- func (isi InfoSchemaImpl) GetRowsFromTable(conv *internal.Conv, tableId string) (interface{}, error)
- func (isi InfoSchemaImpl) GetTableName(dbName string, tableName string) string
- func (isi InfoSchemaImpl) GetTables() ([]common.SchemaAndName, error)
- func (isi InfoSchemaImpl) GetToDdl() common.ToDdl
- func (isi InfoSchemaImpl) ProcessData(conv *internal.Conv, tableId string, srcSchema schema.Table, ...) error
- func (isi InfoSchemaImpl) StartChangeDataCapture(ctx context.Context, conv *internal.Conv) (map[string]interface{}, error)
- func (isi InfoSchemaImpl) StartStreamingMigration(ctx context.Context, client *sp.Client, conv *internal.Conv, ...) (internal.DataflowOutput, error)
- type ToDdlImpl
Constants ¶
This section is empty.
Variables ¶
var ( TimestampReg = regexp.MustCompile(`TIMESTAMP`) IntervalReg = regexp.MustCompile(`INTERVAL`) )
Functions ¶
Types ¶
type InfoSchemaImpl ¶
type InfoSchemaImpl struct { DbName string Db *sql.DB SourceProfile profiles.SourceProfile TargetProfile profiles.TargetProfile }
func (InfoSchemaImpl) GetColumns ¶
func (isi InfoSchemaImpl) GetColumns(conv *internal.Conv, table common.SchemaAndName, constraints map[string][]string, primaryKeys []string) (map[string]schema.Column, []string, error)
GetColumns returns a list of Column objects and names
func (InfoSchemaImpl) GetConstraints ¶
func (isi InfoSchemaImpl) GetConstraints(conv *internal.Conv, table common.SchemaAndName) ([]string, map[string][]string, error)
GetConstraints returns a list of primary keys and by-column map of other constraints. Note: we need to preserve ordinal order of columns in primary key constraints. Note that foreign key constraints are handled in getForeignKeys.
func (InfoSchemaImpl) GetForeignKeys ¶
func (isi InfoSchemaImpl) GetForeignKeys(conv *internal.Conv, table common.SchemaAndName) (foreignKeys []schema.ForeignKey, err error)
GetForeignKeys return list all the foreign keys constraints.
func (InfoSchemaImpl) GetIndexes ¶
func (isi InfoSchemaImpl) GetIndexes(conv *internal.Conv, table common.SchemaAndName, colNameIdMap map[string]string) ([]schema.Index, error)
GetIndexes return a list of all indexes for the specified table. Oracle db support several types of index: 1. Normal indexes. (By default, Oracle Database creates B-tree indexes.) 2.Bitmap indexes 3.Partitioned indexes 4. Function-based indexes 5.Domain indexes, we are only considering normal index as of now.
func (InfoSchemaImpl) GetRowCount ¶
func (isi InfoSchemaImpl) GetRowCount(table common.SchemaAndName) (int64, error)
GetRowCount with number of rows in each table.
func (InfoSchemaImpl) GetRowsFromTable ¶
func (isi InfoSchemaImpl) GetRowsFromTable(conv *internal.Conv, tableId string) (interface{}, error)
GetRowsFromTable returns a sql Rows object for a table.
func (InfoSchemaImpl) GetTableName ¶
func (isi InfoSchemaImpl) GetTableName(dbName string, tableName string) string
GetTableName returns table name.
func (InfoSchemaImpl) GetTables ¶
func (isi InfoSchemaImpl) GetTables() ([]common.SchemaAndName, error)
func (InfoSchemaImpl) GetToDdl ¶
func (isi InfoSchemaImpl) GetToDdl() common.ToDdl
GetToDdl function below implement the common.InfoSchema interface.
func (InfoSchemaImpl) ProcessData ¶
func (isi InfoSchemaImpl) ProcessData(conv *internal.Conv, tableId string, srcSchema schema.Table, commonColIds []string, spSchema ddl.CreateTable, additionalAttributes internal.AdditionalDataAttributes) error
ProcessData performs data conversion for source database.
func (InfoSchemaImpl) StartChangeDataCapture ¶
func (isi InfoSchemaImpl) StartChangeDataCapture(ctx context.Context, conv *internal.Conv) (map[string]interface{}, error)
StartChangeDataCapture is used for automatic triggering of Datastream job when performing a streaming migration.
func (InfoSchemaImpl) StartStreamingMigration ¶
func (isi InfoSchemaImpl) StartStreamingMigration(ctx context.Context, client *sp.Client, conv *internal.Conv, streamingInfo map[string]interface{}) (internal.DataflowOutput, error)
StartStreamingMigration is used for automatic triggering of Dataflow job when performing a streaming migration.
type ToDdlImpl ¶
type ToDdlImpl struct { }
ToDdlImpl oracle specific implementation for ToDdl.
func (ToDdlImpl) ToSpannerType ¶
func (tdi ToDdlImpl) ToSpannerType(conv *internal.Conv, spType string, srcType schema.Type) (ddl.Type, []internal.SchemaIssue)
ToSpannerType maps a scalar source schema type (defined by id and mods) into a Spanner type. This is the core source-to-Spanner type mapping. toSpannerType returns the Spanner type and a list of type conversion issues encountered.