QueryGenerator Class
Helps generate SQL queries for PostgreSQL database operations.
Namespace
DbSyncKit.PostgreSQL
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 QueryGenerator class.

Methods

Name Return Value Summary
Dispose() void
Performs application-defined tasks associated with freeing, releasing, or resetting resources.
EscapeColumn(string) string
Escapes the input column name to be used safely in SQL queries.
EscapeValue(object) object
Escapes special characters in the input string to make it SQL-safe.
GenerateBatchSeparator() string
Generates a batch separator for SQL queries (not used in this implementation).
GenerateComment(string) string
Generates a comment string in either single-line or multi-line format.
GenerateDeleteQuery<T>(T, List<string>) string
Generates a DELETE query based on the provided entity and key columns.
GenerateInsertQuery<T>(T, List<string>, List<string>) string
Generates an INSERT query based on the provided entity, key columns, and excluded columns.
GenerateSelectQuery<T>(string, List<string>, string) string
Generates a SELECT query based on the provided table name, list of columns, and schema name.
GenerateUpdateQuery<T>(T, List<string>, List<string>, (string propName, object propValue)[]) string
Generates an UPDATE query based on the provided 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 SQL WHERE clause based on the specified 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