Class SqlBuilderApi
Represents a single building block of an SQL database.
public abstract class SqlBuilderApi
- Inheritance
-
SqlBuilderApi
- Derived
- Inherited Members
Methods
AddComputationChange(SqlColumnBuilder, SqlColumnComputation?)
Registers a column's Computation change event in the related database's change tracker.
protected static void AddComputationChange(SqlColumnBuilder target, SqlColumnComputation? originalValue)
Parameters
target
SqlColumnBuilderModified column.
originalValue
SqlColumnComputation?Column's Computation value before the change.
AddCreation(SqlObjectBuilder, SqlObjectBuilder)
Registers an object creation event in the related database's change tracker.
protected static void AddCreation(SqlObjectBuilder activeObject, SqlObjectBuilder target)
Parameters
activeObject
SqlObjectBuilderObject for which the change should be registered.
target
SqlObjectBuilderCreated object.
AddDefaultValueChange(SqlColumnBuilder, SqlExpressionNode?)
Registers a column's DefaultValue change event in the related database's change tracker.
protected static void AddDefaultValueChange(SqlColumnBuilder target, SqlExpressionNode? originalValue)
Parameters
target
SqlColumnBuilderModified column.
originalValue
SqlExpressionNodeColumn's DefaultValue value before the change.
AddFilterChange(SqlIndexBuilder, SqlConditionNode?)
Registers an index's Filter change event in the related database's change tracker.
protected static void AddFilterChange(SqlIndexBuilder target, SqlConditionNode? originalValue)
Parameters
target
SqlIndexBuilderModified index.
originalValue
SqlConditionNodeIndex's Filter value before the change.
AddIsNullableChange(SqlColumnBuilder, bool)
Registers a column's IsNullable change event in the related database's change tracker.
protected static void AddIsNullableChange(SqlColumnBuilder target, bool originalValue)
Parameters
target
SqlColumnBuilderModified column.
originalValue
boolColumn's IsNullable value before the change.
AddIsUniqueChange(SqlIndexBuilder, bool)
Registers an index's IsUnique change event in the related database's change tracker.
protected static void AddIsUniqueChange(SqlIndexBuilder target, bool originalValue)
Parameters
target
SqlIndexBuilderModified index.
originalValue
boolIndex's IsUnique value before the change.
AddIsVirtualChange(SqlIndexBuilder, bool)
Registers an index's IsVirtual change event in the related database's change tracker.
protected static void AddIsVirtualChange(SqlIndexBuilder target, bool originalValue)
Parameters
target
SqlIndexBuilderModified index.
originalValue
boolIndex's IsVirtual value before the change.
AddNameChange(SqlObjectBuilder, SqlObjectBuilder, string)
Registers an object Name change event in the related database's change tracker.
protected static void AddNameChange(SqlObjectBuilder activeObject, SqlObjectBuilder target, string originalValue)
Parameters
activeObject
SqlObjectBuilderObject for which the change should be registered.
target
SqlObjectBuilderRenamed object.
originalValue
stringObject's Name before the change.
AddOnDeleteBehaviorChange(SqlForeignKeyBuilder, ReferenceBehavior)
Registers a foreign key's OnDeleteBehavior change event in the related database's change tracker.
protected static void AddOnDeleteBehaviorChange(SqlForeignKeyBuilder target, ReferenceBehavior originalValue)
Parameters
target
SqlForeignKeyBuilderModified foreign key.
originalValue
ReferenceBehaviorForeign key's OnDeleteBehavior value before the change.
AddOnUpdateBehaviorChange(SqlForeignKeyBuilder, ReferenceBehavior)
Registers a foreign key's OnUpdateBehavior change event in the related database's change tracker.
protected static void AddOnUpdateBehaviorChange(SqlForeignKeyBuilder target, ReferenceBehavior originalValue)
Parameters
target
SqlForeignKeyBuilderModified foreign key.
originalValue
ReferenceBehaviorForeign key's OnUpdateBehavior value before the change.
AddPrimaryKeyChange(SqlIndexBuilder, SqlPrimaryKeyBuilder?)
Registers an index's PrimaryKey change event in the related database's change tracker.
protected static void AddPrimaryKeyChange(SqlIndexBuilder target, SqlPrimaryKeyBuilder? originalValue)
Parameters
target
SqlIndexBuilderModified index.
originalValue
SqlPrimaryKeyBuilderIndex's PrimaryKey value before the change.
AddReference(SqlObjectBuilder, SqlObjectBuilderReferenceSource<SqlObjectBuilder>, SqlObjectBuilder?)
Registers a reference in the provided object's ReferencingObjects collection.
protected static bool AddReference(SqlObjectBuilder obj, SqlObjectBuilderReferenceSource<SqlObjectBuilder> source, SqlObjectBuilder? target = null)
Parameters
obj
SqlObjectBuilderObject to register a reference in.
source
SqlObjectBuilderReferenceSource<SqlObjectBuilder>Reference to register.
target
SqlObjectBuilderOptional target (sub-object) of the reference. Equal to null by default.
Returns
- bool
true when reference was registered, otherwise false.
AddRemoval(SqlObjectBuilder, SqlObjectBuilder)
Registers an object removal event in the related database's change tracker.
protected static void AddRemoval(SqlObjectBuilder activeObject, SqlObjectBuilder target)
Parameters
activeObject
SqlObjectBuilderObject for which the change should be registered.
target
SqlObjectBuilderRemoved object.
AddToCollection(SqlConstraintBuilderCollection, SqlConstraintBuilder)
Adds the provided obj
to the constraints collection
.
protected static void AddToCollection(SqlConstraintBuilderCollection collection, SqlConstraintBuilder obj)
Parameters
collection
SqlConstraintBuilderCollectionCollection to add an object to.
obj
SqlConstraintBuilderObject to add.
Remarks
This method automatically adds the obj
to the objects collection of the related schema.
AddToCollection(SqlObjectBuilderCollection, SqlObjectBuilder)
Adds the provided obj
to the objects collection
.
protected static void AddToCollection(SqlObjectBuilderCollection collection, SqlObjectBuilder obj)
Parameters
collection
SqlObjectBuilderCollectionCollection to add an object to.
obj
SqlObjectBuilderObject to add.
AddTypeDefinitionChange(SqlColumnBuilder, SqlColumnTypeDefinition)
Registers a column's TypeDefinition change event in the related database's change tracker.
protected static void AddTypeDefinitionChange(SqlColumnBuilder target, SqlColumnTypeDefinition originalValue)
Parameters
target
SqlColumnBuilderModified column.
originalValue
SqlColumnTypeDefinitionColumn's TypeDefinition value before the change.
ChangeNameInCollection(SqlColumnBuilderCollection, SqlColumnBuilder, string)
Changes the name of the provided obj
in the columns collection
.
protected static void ChangeNameInCollection(SqlColumnBuilderCollection collection, SqlColumnBuilder obj, string newName)
Parameters
collection
SqlColumnBuilderCollectionCollection to change the name in.
obj
SqlColumnBuilderColumn whose name will be changed.
newName
stringNew name of the column.
Exceptions
- SqlObjectBuilderException
When new name already exists in the
collection
or the name is not valid.
ChangeNameInCollection(SqlConstraintBuilderCollection, SqlConstraintBuilder, string)
Changes the name of the provided obj
in the constraints collection
.
protected static void ChangeNameInCollection(SqlConstraintBuilderCollection collection, SqlConstraintBuilder obj, string newName)
Parameters
collection
SqlConstraintBuilderCollectionCollection to change the name in.
obj
SqlConstraintBuilderConstraint whose name will be changed.
newName
stringNew name of the constraint.
Remarks
This method automatically changes the name in the objects collection of the related schema.
Exceptions
- SqlObjectBuilderException
When new name already exists in the
collection
or the name is not valid.
ChangeNameInCollection(SqlObjectBuilderCollection, SqlObjectBuilder, string)
Changes the name of the provided obj
in the objects collection
.
protected static void ChangeNameInCollection(SqlObjectBuilderCollection collection, SqlObjectBuilder obj, string newName)
Parameters
collection
SqlObjectBuilderCollectionCollection to change the name in.
obj
SqlObjectBuilderObject whose name will be changed.
newName
stringNew name of the object.
Exceptions
- SqlObjectBuilderException
When new name already exists in the
collection
or the name is not valid.
ChangeNameInCollection(SqlSchemaBuilderCollection, SqlSchemaBuilder, string)
Changes the name of the provided obj
in the schemas collection
.
protected static void ChangeNameInCollection(SqlSchemaBuilderCollection collection, SqlSchemaBuilder obj, string newName)
Parameters
collection
SqlSchemaBuilderCollectionCollection to change the name in.
obj
SqlSchemaBuilderSchema whose name will be changed.
newName
stringNew name of the schema.
Exceptions
- SqlObjectBuilderException
When new name already exists in the
collection
or the name is not valid.
ClearCollection(SqlColumnBuilderCollection)
Removes all columns from the columns collection
.
protected static void ClearCollection(SqlColumnBuilderCollection collection)
Parameters
collection
SqlColumnBuilderCollectionCollection to clear.
ClearCollection(SqlConstraintBuilderCollection)
Removes all constraints from the constraints collection
.
protected static void ClearCollection(SqlConstraintBuilderCollection collection)
Parameters
collection
SqlConstraintBuilderCollectionCollection to clear.
ClearCollection(SqlObjectBuilderCollection)
Removes all objects from the objects collection
.
protected static void ClearCollection(SqlObjectBuilderCollection collection)
Parameters
collection
SqlObjectBuilderCollectionCollection to clear.
ClearReferences(SqlObjectBuilder)
Removes all references from the provided object's ReferencingObjects collection.
protected static void ClearReferences(SqlObjectBuilder obj)
Parameters
obj
SqlObjectBuilderObject to remove all references from.
GetObjectPool(SqlDatabaseBuilder)
Returns the underlying object pool.
[Pure]
protected static MemorySequencePool<SqlObjectBuilder> GetObjectPool(SqlDatabaseBuilder database)
Parameters
database
SqlDatabaseBuilderSource of the object pool.
Returns
- MemorySequencePool<SqlObjectBuilder>
Database's underlying object pool.
QuickRemove(SqlObjectBuilder)
Performs a quick removal of the provided obj
.
protected static void QuickRemove(SqlObjectBuilder obj)
Parameters
obj
SqlObjectBuilderObject to remove.
Remarks
Quick removal is faster than normal removal but it is less safe and it should only be used when the object's parent is being removed.
RemoveFromCollection(SqlColumnBuilderCollection, SqlColumnBuilder)
Removes the provided obj
from the columns collection
.
protected static void RemoveFromCollection(SqlColumnBuilderCollection collection, SqlColumnBuilder obj)
Parameters
collection
SqlColumnBuilderCollectionCollection to remove a column from.
obj
SqlColumnBuilderColumn to remove.
RemoveFromCollection(SqlConstraintBuilderCollection, SqlConstraintBuilder)
Removes the provided obj
from the constraints collection
.
protected static void RemoveFromCollection(SqlConstraintBuilderCollection collection, SqlConstraintBuilder obj)
Parameters
collection
SqlConstraintBuilderCollectionCollection to remove a constraint from.
obj
SqlConstraintBuilderConstraint to remove.
Remarks
This method automatically removed the obj
from the objects collection of the related schema.
RemoveFromCollection(SqlObjectBuilderCollection, SqlObjectBuilder)
Removes the provided obj
from the objects collection
.
protected static void RemoveFromCollection(SqlObjectBuilderCollection collection, SqlObjectBuilder obj)
Parameters
collection
SqlObjectBuilderCollectionCollection to remove an object from.
obj
SqlObjectBuilderObject to remove.
RemoveFromCollection(SqlSchemaBuilderCollection, SqlSchemaBuilder)
Removes the provided obj
from the schemas collection
.
protected static void RemoveFromCollection(SqlSchemaBuilderCollection collection, SqlSchemaBuilder obj)
Parameters
collection
SqlSchemaBuilderCollectionCollection to remove a schema from.
obj
SqlSchemaBuilderSchema to remove.
RemoveReference(SqlObjectBuilder, SqlObjectBuilderReferenceSource<SqlObjectBuilder>)
Removes a reference from the provided object's ReferencingObjects collection.
protected static bool RemoveReference(SqlObjectBuilder obj, SqlObjectBuilderReferenceSource<SqlObjectBuilder> source)
Parameters
obj
SqlObjectBuilderObject to remove a reference from.
source
SqlObjectBuilderReferenceSource<SqlObjectBuilder>Reference to remove.
Returns
- bool
true when reference was removed, otherwise false.
ResetInfo(SqlTableBuilder)
Resets the underlying Info cache.
protected static void ResetInfo(SqlTableBuilder target)
Parameters
target
SqlTableBuilderTable to reset the cache for.
ResetInfo(SqlViewBuilder)
Resets the underlying Info cache.
protected static void ResetInfo(SqlViewBuilder target)
Parameters
target
SqlViewBuilderView to reset the cache for.