Skip to main content

sqlformats-class

Represents different formats of SQL statements.

public class Korzh.EasyQuery.Db.SqlFormats

Assembly: Korzh.EasyQuery.Db.dll

Constructors

NameTypeDescription
SqlFormats()voidInitializes a new instance of the Korzh.EasyQuery.Db.SqlFormats class.

Fields

NameTypeDescription
QuotedTypesDataTypeListRepresents list of data types that must be quoted in result SQL.
SqlSyntaxSqlSyntaxGets or sets the type of SQL syntax.

Properties

NameTypeDescription
AlphaAliasboolGets or sets a value indicating whether column alias should have only "alpha" symbols.
AlwaysQuoteboolDetermines whether columns and tables should be always quoted in SQL.
AutoOuterJoinsboolWhen true the builder will automatically convert an INNER join to OUTER one if the previous joins in the query were also OUTER (to prevent records missing)
BracketJoinsboolGets or sets a value indicating whether Korzh.EasyQuery must bracket joins in result SQL statement.
DateFormatstringGets or sets the format of date constant values in generated SQL statements.
DateTimeFormatstringGets or sets the format of date/time constant values in generated SQL statements.
DefaultSchemaNamestringGets or sets the name of the default schema.
EOLEOLSymbolGets or sets the end-of-line symbol(s)
EscapeSymbolstringGets or sets the escape symbol.
FalseValuestringGets or sets the text used for "False" value in SQL expressions.
FilterModeboolGets or sets a value indicating whether we should generate the query for filter (e.g. without table names in field representations).
FormatTypeFormatTypeGets or sets the format type.
GroupByCalcColumnsboolGets or sets a value indicating whether SQL generator should use calculated columns "as is" in GROUP BY clause
IdentQuote1CharGets or sets the left quote symbol for identifiers (double-quote by default).
IdentQuote2CharGets or sets the right quote symbol for identifiers (double-quote by default).
JoinsOrderJoinsOrderGets or sets the type of table order in the FROM clause of generated SQL statement
LegacyPagingboolGet or sets value indicating whether paging should be made using ROW_NUMBER() function.
LimitClauseTemplatestringGets or sets template clause for pagination (default value depends on database).
LowerFuncNamestringGets or sets the name of the LOWER function.
MaxIdentLenintGets or sets a maximum length of identifiers (e.g. table or column aliases) in generated queries. 0 - means that this options is ignored
MoneySuffixstringGets or sets the suffix for the values with "money" or "currency" types.
OrderByStyleOrderByStylesGets or sets the style of ORDER BY clause.
ParameterPrefixstringGets or sets the prefix symbol which precedes the parameter names in generated SQL statement. Usually it's '@' symbol but for some databases it must be set to ':'
PrefixUnicodeConstsboolGets or sets a value indicating whether SQL generator should add 'N' prefix before string constants with Unicode characters
QuoteBoolboolGets or sets a value indicating whether currently used SQL syntax requires to quote the boolean values.
QuoteColumnAliasboolGets or sets a value indicating whether all columns aliases must be quotes in result SQL.
QuoteTimeboolGets or sets a value indicating whether currently used SQL syntax requires to quote the date and time values.
RecordCountTemplatestringGets or sets template clause for count records (default value depends on database).
RowNumberAliasstringGets or sets the alias for ROW_NUMBER column. This option is used only when LegacyPaging is turned on.
SqlFunctionsIDictionary<string, string>Gets the dictionary of most common SQL functions. The key in each entry of this dictionary is a function name used in EasyQuery expressions. The value is the function template with $1, $2, etc used as function parameters
SqlQuote1CharGets or sets the left quote symbol (double-quote by default).
SqlQuote2CharGets or sets the right quote symbol (double-quote by default).
SupportHashJoinboolGets or sets a value indicating wether DB supports (LEFT
SupportPagingboolGets or sets a value indicating whether paging commands (like OFFSET/FETCH) are supported.
SupportRightJoinboolGets or sets a value indicating wether DB supports RIGHT JOINs.
TimeFormatstringGets or sets the format of time constant values used in generated SQL statements.
TrueValuestringGets or sets the text used for "True" value in SQL expressions.
UseAsInFromboolGets or sets a value indicating whether we must add AS conjuction between table name and alias in the FROM clause.
UseColumnAliasesColumnAliasesUsageGets or sets the value that determine when column aliases must be used in result SQL.
UseDbNameboolGets or sets a value indicating whether Korzh.EasyQuery will add database name into table names in result SQL statememnt.
UseSchemaboolGets or sets a value indicating whether Korzh.EasyQuery will use schema in result SQL statememnt.
UseTableAliasboolGets or sets a value indicating whether we will use table aliases in generated queries.
WildcardAnyCharGets or sets the wild symbol used in LIKE SQL operator (% by default).
WildcardSingleCharGets or sets the wildcard symbol used in LIKE SQL operator to match any single charcter (_ by default).

Methods

NameTypeDescription
AddDefaultSqlFunctions()void
CopyFrom(SqlFormats source)voidCopies the formats from another formats object.
CopyFromCore(SqlFormats source)voidCopies all formats from some Korzh.EasyQuery.Db.SqlFormats object.
Equals(object obj)boolDetermines whether the specified System.Object is equal to this instance.
GetEolSymbol()stringGets the string representation of end-of-line symbol(s)
GetHashCode()intReturns a hash code for this instance.
IsQuotedType(DataType type)boolDetermines whether the specified type must be quoted.
LoadFromXmlReader(XmlReader reader)voidLoads formats from XML reader.
LoadNode(string nodeName, string nodeValue)voidLoads the root node of the Korzh.EasyQuery.Db.SqlFormats object.
QuoteIdentifier(string ident)stringReturns the string passed in paraters wrapped with IdentQuote1 and IdentQuote2 symbols
ReadFromJsonAsync(JsonReader reader)TaskLoads QueryFormats from JSON (asynchronous way). Calls Korzh.EasyQuery.Db.SqlFormats.ReadOnePropFromJsonAsync(Newtonsoft.Json.JsonReader,System.String) function.
ReadOnePropFromJsonAsync(JsonReader reader, string propName)TaskLoads a property of QueryFormats (asynchronous way).
SaveNodes(XmlWriter writer)voidSaves Korzh.EasyQuery.Db.SqlFormats object to XML writer.
SaveToXmlWriter(XmlWriter writer, string rootNodeName)voidSaves formats to XML writer.
SetDefaultFormats(FormatType formatType)voidSets the default formats for different types of databases.
WriteContentToJsonAsync(JsonWriter writer)TaskSaves the properties of QueryFormats to JSON (asynchronous way).
WriteToJsonAsync(JsonWriter writer)TaskSaves QueryFormats to JSON (asynchronous way). Calls Korzh.EasyQuery.Db.SqlFormats.WriteContentToJsonAsync(Newtonsoft.Json.JsonWriter) function.

Static Properties

NameTypeDescription
DefaultSqlFormatsGets the default set of formats.