sequence

package
v1.10.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const Version string = "v1"

Version of the YAML strcuture.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dialect

type Dialect interface {
	// SequencesSQL return SQL command to list sequences from meta data
	SequencesSQL(schema string) string
	// UpdateSequenceSQL return SQL Command to update sequence to max +1  of tablename/column values
	UpdateSequenceSQL(schema string, sequence string, tableName string, column string) string
	StatusSequenceSQL(schema string, sequence string) string
}

type OracleDialect

type OracleDialect struct{}

func (OracleDialect) SequencesSQL

func (d OracleDialect) SequencesSQL(schema string) string

func (OracleDialect) StatusSequenceSQL

func (d OracleDialect) StatusSequenceSQL(schema string, sequence string) string

func (OracleDialect) UpdateSequenceSQL

func (d OracleDialect) UpdateSequenceSQL(schema string, sequence string, tableName string, column string) string

type OracleUpdatorFactory

type OracleUpdatorFactory struct{}

OracleExtractorFactory exposes methods to create new Oracle extractors.

func NewOracleUpdatorFactory

func NewOracleUpdatorFactory() *OracleUpdatorFactory

NewOracleExtractorFactory creates a new oracle extractor factory.

func (*OracleUpdatorFactory) New

func (e *OracleUpdatorFactory) New(url string, schema string) sequence.Updator

New return a Oracle extractor

type PostgresDialect

type PostgresDialect struct{}

func (PostgresDialect) SequencesSQL

func (d PostgresDialect) SequencesSQL(schema string) string

func (PostgresDialect) StatusSequenceSQL

func (d PostgresDialect) StatusSequenceSQL(schema string, sequence string) string

func (PostgresDialect) UpdateSequenceSQL

func (d PostgresDialect) UpdateSequenceSQL(schema string, sequence string, tableName string, column string) string

type PostgresUpdatorFactory

type PostgresUpdatorFactory struct{}

PostgresUpdatorFactory exposes methods to create new Postgres extractors.

func NewPostgresUpdatorFactory

func NewPostgresUpdatorFactory() *PostgresUpdatorFactory

NewPostgresUpdatorFactory creates a new postgres extractor factory.

func (*PostgresUpdatorFactory) New

func (e *PostgresUpdatorFactory) New(url string, schema string) sequence.Updator

New return a Postgres extractor

type SQLUpdator

type SQLUpdator struct {
	// contains filtered or unexported fields
}

SQLUpdator provides table extraction logic from SQL database.

func NewSQLUpdator

func NewSQLUpdator(url string, schema string, dialect Dialect) *SQLUpdator

NewSQLUpdator creates a new SQL Updator.

func (*SQLUpdator) Extract

func (e *SQLUpdator) Extract() ([]string, *sequence.Error)

Extract the sequences name from the data base

func (SQLUpdator) Status

Status get the current value of the sequence

func (*SQLUpdator) Update

func (e *SQLUpdator) Update(seqList []sequence.Sequence) *sequence.Error

Update sequence

type YAMLSequence

type YAMLSequence struct {
	Name   string `yaml:"name"`
	Table  string `yaml:"table"`
	Column string `yaml:"column"`
}

YAMLSequence defines how to store a sequence

type YAMLStorage

type YAMLStorage struct{}

YAMLStorage provides storage in a local YAML file

func NewYAMLStorage

func NewYAMLStorage() *YAMLStorage

NewYAMLStorage create a new YAML storage

func (YAMLStorage) List

func (s YAMLStorage) List() ([]sequence.Sequence, *sequence.Error)

List all tables stored in the YAML file

func (YAMLStorage) Store

func (s YAMLStorage) Store(sequences []sequence.Sequence) *sequence.Error

Store tables in the YAML file

type YAMLStructure

type YAMLStructure struct {
	Version  string         `yaml:"version"`
	Sequence []YAMLSequence `yaml:"sequences,omitempty"`
}

YAMLStructure of the file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL