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
targetSqlColumnBuilderModified column.
originalValueSqlColumnComputation?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
activeObjectSqlObjectBuilderObject for which the change should be registered.
targetSqlObjectBuilderCreated 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
targetSqlColumnBuilderModified column.
originalValueSqlExpressionNodeColumn'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
targetSqlIndexBuilderModified index.
originalValueSqlConditionNodeIndex'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
targetSqlColumnBuilderModified column.
originalValueboolColumn'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
targetSqlIndexBuilderModified index.
originalValueboolIndex'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
targetSqlIndexBuilderModified index.
originalValueboolIndex'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
activeObjectSqlObjectBuilderObject for which the change should be registered.
targetSqlObjectBuilderRenamed object.
originalValuestringObject'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
targetSqlForeignKeyBuilderModified foreign key.
originalValueReferenceBehaviorForeign 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
targetSqlForeignKeyBuilderModified foreign key.
originalValueReferenceBehaviorForeign 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
targetSqlIndexBuilderModified index.
originalValueSqlPrimaryKeyBuilderIndex'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
objSqlObjectBuilderObject to register a reference in.
sourceSqlObjectBuilderReferenceSource<SqlObjectBuilder>Reference to register.
targetSqlObjectBuilderOptional 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
activeObjectSqlObjectBuilderObject for which the change should be registered.
targetSqlObjectBuilderRemoved object.
AddToCollection(SqlConstraintBuilderCollection, SqlConstraintBuilder)
Adds the provided obj to the constraints collection.
protected static void AddToCollection(SqlConstraintBuilderCollection collection, SqlConstraintBuilder obj)
Parameters
collectionSqlConstraintBuilderCollectionCollection to add an object to.
objSqlConstraintBuilderObject 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
collectionSqlObjectBuilderCollectionCollection to add an object to.
objSqlObjectBuilderObject 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
targetSqlColumnBuilderModified column.
originalValueSqlColumnTypeDefinitionColumn'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
collectionSqlColumnBuilderCollectionCollection to change the name in.
objSqlColumnBuilderColumn whose name will be changed.
newNamestringNew name of the column.
Exceptions
- SqlObjectBuilderException
When new name already exists in the
collectionor 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
collectionSqlConstraintBuilderCollectionCollection to change the name in.
objSqlConstraintBuilderConstraint whose name will be changed.
newNamestringNew 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
collectionor 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
collectionSqlObjectBuilderCollectionCollection to change the name in.
objSqlObjectBuilderObject whose name will be changed.
newNamestringNew name of the object.
Exceptions
- SqlObjectBuilderException
When new name already exists in the
collectionor 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
collectionSqlSchemaBuilderCollectionCollection to change the name in.
objSqlSchemaBuilderSchema whose name will be changed.
newNamestringNew name of the schema.
Exceptions
- SqlObjectBuilderException
When new name already exists in the
collectionor the name is not valid.
ClearCollection(SqlColumnBuilderCollection)
Removes all columns from the columns collection.
protected static void ClearCollection(SqlColumnBuilderCollection collection)
Parameters
collectionSqlColumnBuilderCollectionCollection to clear.
ClearCollection(SqlConstraintBuilderCollection)
Removes all constraints from the constraints collection.
protected static void ClearCollection(SqlConstraintBuilderCollection collection)
Parameters
collectionSqlConstraintBuilderCollectionCollection to clear.
ClearCollection(SqlObjectBuilderCollection)
Removes all objects from the objects collection.
protected static void ClearCollection(SqlObjectBuilderCollection collection)
Parameters
collectionSqlObjectBuilderCollectionCollection to clear.
ClearReferences(SqlObjectBuilder)
Removes all references from the provided object's ReferencingObjects collection.
protected static void ClearReferences(SqlObjectBuilder obj)
Parameters
objSqlObjectBuilderObject to remove all references from.
GetObjectPool(SqlDatabaseBuilder)
Returns the underlying object pool.
[Pure]
protected static MemorySequencePool<SqlObjectBuilder> GetObjectPool(SqlDatabaseBuilder database)
Parameters
databaseSqlDatabaseBuilderSource 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
objSqlObjectBuilderObject 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
collectionSqlColumnBuilderCollectionCollection to remove a column from.
objSqlColumnBuilderColumn to remove.
RemoveFromCollection(SqlConstraintBuilderCollection, SqlConstraintBuilder)
Removes the provided obj from the constraints collection.
protected static void RemoveFromCollection(SqlConstraintBuilderCollection collection, SqlConstraintBuilder obj)
Parameters
collectionSqlConstraintBuilderCollectionCollection to remove a constraint from.
objSqlConstraintBuilderConstraint 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
collectionSqlObjectBuilderCollectionCollection to remove an object from.
objSqlObjectBuilderObject to remove.
RemoveFromCollection(SqlSchemaBuilderCollection, SqlSchemaBuilder)
Removes the provided obj from the schemas collection.
protected static void RemoveFromCollection(SqlSchemaBuilderCollection collection, SqlSchemaBuilder obj)
Parameters
collectionSqlSchemaBuilderCollectionCollection to remove a schema from.
objSqlSchemaBuilderSchema 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
objSqlObjectBuilderObject to remove a reference from.
sourceSqlObjectBuilderReferenceSource<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
targetSqlTableBuilderTable to reset the cache for.
ResetInfo(SqlViewBuilder)
Resets the underlying Info cache.
protected static void ResetInfo(SqlViewBuilder target)
Parameters
targetSqlViewBuilderView to reset the cache for.