QueryGenerator Class
Helps generate SQL queries for MySQL database operations.
Namespace
DbSyncKit.MySQL
Interfaces
Base Types
graph BT Type-->Base0["QueryHelper"] click Base0 "/api/DbSyncKit.DB.Helper/QueryHelper" Base0-->Base1["object"] Type-.->Interface0["IQueryGenerator"] click Interface0 "/api/DbSyncKit.Templates.Interface/IQueryGenerator" Type-.->Interface1["IDisposable"] Type["QueryGenerator"] class Type type-node

Syntax

public class QueryGenerator : QueryHelper, IQueryGenerator, IDisposable

Constructors

Name Summary
QueryGenerator() Initializes a new instance of the System.Text.StringBuilder class.

Methods

Name Return Value Summary
Dispose() void
Performs application-defined tasks associated with freeing, releasing, or resetting resources.
EscapeColumn(string) string
Escapes a column name with backticks for MySQL.
EscapeValue(object) object
Escapes a value to be safely used in a SQL query.
GenerateBatchSeparator() string
Generates a batch separator for SQL queries (not used in this implementation).
GenerateComment(string) string
Generates a comment for SQL queries.
GenerateDeleteQuery<T>(T, List<string>) string
Generates a delete query for a given entity and key columns.
GenerateInsertQuery<T>(T, List<string>, List<string>) string
Generates an insert query for a given entity, key columns, and excluded columns.
GenerateSelectQuery<T>(string, List<string>, string) string
Generates a select query for a given entity and columns.
GenerateUpdateQuery<T>(T, List<string>, List<string>, (string propName, object propValue)[]) string
Generates an update query for a given entity, key columns, excluded columns, and edited properties.
GetAllColumns<T>() List<string>
Gets the names of all properties for a specified type.
Inherited from QueryHelper
GetComparableProperties<T>() PropertyInfo[]
Retrieves an array of System.Reflection.PropertyInfo objects representing the properties that are used for data comparison in objects of type T.
Inherited from QueryHelper
GetCondition<T>(T, List<string>) List<string>
Generates a condition for a given entity and key columns.
GetExcludedColumns<T>() List<string>
Gets the names of properties marked as excluded properties for a specified type.
Inherited from QueryHelper
GetIdentityColumns<T>() List<string>
Retrieves a list of identity columns for a specified data contract type T.
Inherited from QueryHelper
GetIncludeIdentityInsert<T>() bool
Gets whether the type specifies to include database-specific SQL statements for identity insert behavior during insert query generation, considering the GenerateInsertWithIDAttribute if present.
Inherited from QueryHelper
GetInsertWithID<T>() bool
Gets whether the type specifies to generate an INSERT query with ID, considering the GenerateInsertWithIDAttribute if present.
Inherited from QueryHelper
GetKeyColumns<T>() List<string>
Gets the names of properties marked as key columns for a specified type.
Inherited from QueryHelper
GetKeyProperties<T>() PropertyInfo[]
Retrieves an array of System.Reflection.PropertyInfo objects representing the properties that are used as key properties for uniquely identifying objects of type T.
Inherited from QueryHelper
GetTableName<T>() string
Gets the table name of a specified type, considering the TableNameAttribute if present.
Inherited from QueryHelper
GetTableSchema<T>() string
Gets the table schema of a specified type, considering the TableSchemaAttribute if present.
Inherited from QueryHelper