C# Class Rsdn.Janus.DBSchemaDriverBase

Inheritance: IDBSchemaDriver
Afficher le fichier Open project: rsdn/janus

Méthodes publiques

Méthode Description
BeginTableLoad ( IDbConnection connection, TableSchema table ) : void
CompareDbsc ( DBSchema mbDbsc, string targetConnStr ) : void

Сравнение схемы с эталонной и выдача во внутреннюю хеш таблицу DDL комманд, выполнение общих для всех движков действий.

ConvertToDbParameter ( Rsdn.Janus.TableColumnSchema column, IDbDataParameter parameter ) : IDbDataParameter
CreateConnection ( string connStr ) : IDbConnection
CreateDatabase ( string constr ) : void
EndTableLoad ( IDbConnection connection, TableSchema table ) : void
LoadExistingSchema ( string connStr ) : DBSchema

Создать схему метаданных из исходной базы

MakeInsert ( TableSchema table ) : string
MakeSelect ( TableSchema table, bool orderedByPK ) : string
Prepare ( string connStr ) : void
PrepareToSqlFile ( string path ) : void

Méthodes protégées

Méthode Description
AddDdlCommand ( int priority, [ name, [ type, [ statement ) : void

Добавить DDL команду.

AfterSchemaComparision ( DBSchema existingSchema, DBSchema targetSchema ) : void

Препроцесинг схем, детали для разных движков

CheckIndexTypeForRecreate ( IndexSchema eIndex ) : bool

Проверка необходимости пересоздания связанных Foreign Key при удалении индекса

CheckKeyTypeForRecreate ( KeySchema eKey ) : bool

Проверка необходимости пересоздания связанных Foreign Key при удаление констрента

DBSchemaDriverBase ( ) : System
DbscCopyPrepare ( DBSchema schema ) : DBSchema

Так как схема - референс тип, создание его глубокой копии. Которая при приведение к искомому движку бедет правиться. И приведение её к исходному движку

DeleteDdlCommandsByFilter ( [ filter ) : void

Удалить DDL команды по заданному фильтру.

ExecuteDdlCommands ( IEnumerable commands, string connStr ) : void

Выполнить набор DDL команд.

MakeDdlColumnAlter ( Rsdn.Janus.TableColumnSchema mColumn, Rsdn.Janus.TableColumnSchema eColumn, TableSchema table ) : string
MakeDdlColumnDrop ( Rsdn.Janus.TableColumnSchema column, TableSchema table ) : string
MakeDdlDefaultCreate ( KeySchema key, TableSchema table ) : string
MakeDdlDefaultDrop ( KeySchema key, TableSchema table ) : string
MakeDdlElementName ( string name ) : string
MakeDdlIndexCreate ( IndexSchema index, TableSchema table ) : string
MakeDdlIndexDrop ( IndexSchema index, TableSchema table ) : string
MakeDdlKeyCreateByAlter ( KeySchema key, TableSchema table ) : string
MakeDdlKeyDrop ( KeySchema key, TableSchema table ) : string
MakeDdlTableCopy ( TableSchema toTable, TableSchema fromTable ) : string
MakeDdlTableCreate ( TableSchema table, bool withConstraint ) : string
MakeDdlTableDrop ( TableSchema table ) : string
MakeDdlTableRename ( TableSchema table, string newName ) : string
MakeParameterName ( Rsdn.Janus.TableColumnSchema column ) : string
ParseColumn ( Rsdn.Janus.TableColumnSchema column ) : string
ParseColumnAlter ( Rsdn.Janus.TableColumnSchema mColumn, Rsdn.Janus.TableColumnSchema eColumn ) : string
ParseColumnListIndex ( string iclist ) : IEnumerable
ParseKey ( KeySchema key ) : string
WriteDdlCommands ( TextWriter wr, IEnumerable commands ) : void

Записать набор DDL команд с помощью писателя.

Private Methods

Méthode Description
GetFilteredDdlStatements ( [ filter, [ sort ) : IEnumerable

Получить набор DDL операторов по заданному фильтру.

HelperTableCreate ( TableSchema mTable, int i ) : void
HelperTableDrop ( TableSchema eTable, IEnumerable eTables, int i ) : void
MakeDdlColumnCreate ( Rsdn.Janus.TableColumnSchema column, TableSchema table ) : string
ParseColumnListIndexClear ( string iclist, IndexClearType ctype ) : IEnumerable

ParseColumnListIndexClear ( string cList ) : string
Reparse ( ) : List

Метод ресортирует операторы DDL из кучи в соответствии с логикой и очередностью их выполнения. Очень важный момент!

Method Details

AddDdlCommand() protected méthode

Добавить DDL команду.
protected AddDdlCommand ( int priority, [ name, [ type, [ statement ) : void
priority int
name [
type [
statement [
Résultat void

AfterSchemaComparision() protected méthode

Препроцесинг схем, детали для разных движков
protected AfterSchemaComparision ( DBSchema existingSchema, DBSchema targetSchema ) : void
existingSchema DBSchema Существующая схема
targetSchema DBSchema Эталоная схема
Résultat void

BeginTableLoad() public méthode

public BeginTableLoad ( IDbConnection connection, TableSchema table ) : void
connection IDbConnection
table TableSchema
Résultat void

CheckIndexTypeForRecreate() protected abstract méthode

Проверка необходимости пересоздания связанных Foreign Key при удалении индекса
protected abstract CheckIndexTypeForRecreate ( IndexSchema eIndex ) : bool
eIndex IndexSchema
Résultat bool

CheckKeyTypeForRecreate() protected abstract méthode

Проверка необходимости пересоздания связанных Foreign Key при удаление констрента
protected abstract CheckKeyTypeForRecreate ( KeySchema eKey ) : bool
eKey KeySchema
Résultat bool

CompareDbsc() public méthode

Сравнение схемы с эталонной и выдача во внутреннюю хеш таблицу DDL комманд, выполнение общих для всех движков действий.
public CompareDbsc ( DBSchema mbDbsc, string targetConnStr ) : void
mbDbsc DBSchema
targetConnStr string
Résultat void

ConvertToDbParameter() public méthode

public ConvertToDbParameter ( Rsdn.Janus.TableColumnSchema column, IDbDataParameter parameter ) : IDbDataParameter
column Rsdn.Janus.TableColumnSchema
parameter IDbDataParameter
Résultat IDbDataParameter

CreateConnection() public abstract méthode

public abstract CreateConnection ( string connStr ) : IDbConnection
connStr string
Résultat IDbConnection

CreateDatabase() public abstract méthode

public abstract CreateDatabase ( string constr ) : void
constr string
Résultat void

DBSchemaDriverBase() protected méthode

protected DBSchemaDriverBase ( ) : System
Résultat System

DbscCopyPrepare() protected abstract méthode

Так как схема - референс тип, создание его глубокой копии. Которая при приведение к искомому движку бедет правиться. И приведение её к исходному движку
protected abstract DbscCopyPrepare ( DBSchema schema ) : DBSchema
schema DBSchema Эталоная схема
Résultat DBSchema

DeleteDdlCommandsByFilter() protected méthode

Удалить DDL команды по заданному фильтру.
protected DeleteDdlCommandsByFilter ( [ filter ) : void
filter [ фильтр
Résultat void

EndTableLoad() public méthode

public EndTableLoad ( IDbConnection connection, TableSchema table ) : void
connection IDbConnection
table TableSchema
Résultat void

ExecuteDdlCommands() protected abstract méthode

Выполнить набор DDL команд.
protected abstract ExecuteDdlCommands ( IEnumerable commands, string connStr ) : void
commands IEnumerable набор DDL команд
connStr string
Résultat void

LoadExistingSchema() public abstract méthode

Создать схему метаданных из исходной базы
public abstract LoadExistingSchema ( string connStr ) : DBSchema
connStr string
Résultat DBSchema

MakeDdlColumnAlter() protected méthode

protected MakeDdlColumnAlter ( Rsdn.Janus.TableColumnSchema mColumn, Rsdn.Janus.TableColumnSchema eColumn, TableSchema table ) : string
mColumn Rsdn.Janus.TableColumnSchema
eColumn Rsdn.Janus.TableColumnSchema
table TableSchema
Résultat string

MakeDdlColumnDrop() protected méthode

protected MakeDdlColumnDrop ( Rsdn.Janus.TableColumnSchema column, TableSchema table ) : string
column Rsdn.Janus.TableColumnSchema
table TableSchema
Résultat string

MakeDdlDefaultCreate() protected méthode

protected MakeDdlDefaultCreate ( KeySchema key, TableSchema table ) : string
key KeySchema
table TableSchema
Résultat string

MakeDdlDefaultDrop() protected méthode

protected MakeDdlDefaultDrop ( KeySchema key, TableSchema table ) : string
key KeySchema
table TableSchema
Résultat string

MakeDdlElementName() protected méthode

protected MakeDdlElementName ( string name ) : string
name string
Résultat string

MakeDdlIndexCreate() protected abstract méthode

protected abstract MakeDdlIndexCreate ( IndexSchema index, TableSchema table ) : string
index IndexSchema
table TableSchema
Résultat string

MakeDdlIndexDrop() protected méthode

protected MakeDdlIndexDrop ( IndexSchema index, TableSchema table ) : string
index IndexSchema
table TableSchema
Résultat string

MakeDdlKeyCreateByAlter() protected méthode

protected MakeDdlKeyCreateByAlter ( KeySchema key, TableSchema table ) : string
key KeySchema
table TableSchema
Résultat string

MakeDdlKeyDrop() protected méthode

protected MakeDdlKeyDrop ( KeySchema key, TableSchema table ) : string
key KeySchema
table TableSchema
Résultat string

MakeDdlTableCopy() protected méthode

protected MakeDdlTableCopy ( TableSchema toTable, TableSchema fromTable ) : string
toTable TableSchema
fromTable TableSchema
Résultat string

MakeDdlTableCreate() protected méthode

protected MakeDdlTableCreate ( TableSchema table, bool withConstraint ) : string
table TableSchema
withConstraint bool
Résultat string

MakeDdlTableDrop() protected méthode

protected MakeDdlTableDrop ( TableSchema table ) : string
table TableSchema
Résultat string

MakeDdlTableRename() protected méthode

protected MakeDdlTableRename ( TableSchema table, string newName ) : string
table TableSchema
newName string
Résultat string

MakeInsert() public méthode

public MakeInsert ( TableSchema table ) : string
table TableSchema
Résultat string

MakeParameterName() protected méthode

protected MakeParameterName ( Rsdn.Janus.TableColumnSchema column ) : string
column Rsdn.Janus.TableColumnSchema
Résultat string

MakeSelect() public méthode

public MakeSelect ( TableSchema table, bool orderedByPK ) : string
table TableSchema
orderedByPK bool
Résultat string

ParseColumn() protected abstract méthode

protected abstract ParseColumn ( Rsdn.Janus.TableColumnSchema column ) : string
column Rsdn.Janus.TableColumnSchema
Résultat string

ParseColumnAlter() protected abstract méthode

protected abstract ParseColumnAlter ( Rsdn.Janus.TableColumnSchema mColumn, Rsdn.Janus.TableColumnSchema eColumn ) : string
mColumn Rsdn.Janus.TableColumnSchema
eColumn Rsdn.Janus.TableColumnSchema
Résultat string

ParseColumnListIndex() protected méthode

protected ParseColumnListIndex ( string iclist ) : IEnumerable
iclist string
Résultat IEnumerable

ParseKey() protected méthode

protected ParseKey ( KeySchema key ) : string
key KeySchema
Résultat string

Prepare() public méthode

public Prepare ( string connStr ) : void
connStr string
Résultat void

PrepareToSqlFile() public méthode

public PrepareToSqlFile ( string path ) : void
path string
Résultat void

WriteDdlCommands() protected abstract méthode

Записать набор DDL команд с помощью писателя.
protected abstract WriteDdlCommands ( TextWriter wr, IEnumerable commands ) : void
wr System.IO.TextWriter писатель
commands IEnumerable набор DDL команд
Résultat void