Interface ISqlBuilder
SQL builder interface
Namespace: XData.Interfaces
Assembly: XData.docfx.dll
Syntax
public interface ISqlBuilder
Properties
| Improve this Doc View SourceDialectOptions
Dialect options
WARNING! Mast to be filled in constructor!
Declaration
DialectOptions DialectOptions { get; }
Property Value
Type | Description |
---|---|
DialectOptions |
Item[Enum]
Predefined queries
Declaration
Query this[Enum i] { get; }
Parameters
Type | Name | Description |
---|---|---|
Enum | i | Query enumerated index |
Property Value
Type | Description |
---|---|
Query | Query |
ParameterPrefix
Parameter prefix in SQL dialect
Declaration
string ParameterPrefix { get; }
Property Value
Type | Description |
---|---|
String |
SqlTypes
List of supported SQL types
WARNING! Mast to be filled in constructor!
Declaration
DbType[] SqlTypes { get; }
Property Value
Type | Description |
---|---|
DbType[] |
SqlTypeSizes
List of supported type size applicable
WARNING! Mast to be filled in constructor!
Declaration
Dictionary<string, SqlTypeSize> SqlTypeSizes { get; }
Property Value
Type | Description |
---|---|
Dictionary<String, SqlTypeSize> |
TypeNames
List of supported column type names
WARNING! Mast to be filled in constructor!
Declaration
string[] TypeNames { get; }
Property Value
Type | Description |
---|---|
String[] |
TypeSynonyms
List of supported type synonyms
WARNING! Mast to be filled in constructor!
Declaration
string[] TypeSynonyms { get; }
Property Value
Type | Description |
---|---|
String[] |
Methods
| Improve this Doc View SourceExtractXmlQuery(String, String, String[], IComparable[], String, KeyValuePair<String, String>[])
Returns query to extract XML data by XPath expression
Declaration
Query ExtractXmlQuery(string table, string column, string[] tablePrimaryKey, IComparable[] primaryKeyValue, string path, params KeyValuePair<string, string>[] namespaces)
Parameters
Type | Name | Description |
---|---|---|
String | table | Table name |
String | column | XML column name |
String[] | tablePrimaryKey | Table primary key columns |
IComparable[] | primaryKeyValue | Table primary key values |
String | path | XPath expression |
KeyValuePair<String, String>[] | namespaces | XPath namespaces |
Returns
Type | Description |
---|---|
Query | XPath result |
GetAcquireBlobQuery(String, String, IEnumerable<String>, IComparable[], String)
Returns query to acquire blob data
Declaration
Query GetAcquireBlobQuery(string table, string column, IEnumerable<string> tablePrimaryKey, IComparable[] primaryKeyValue, string nativeSqlType = null)
Parameters
Type | Name | Description |
---|---|---|
String | table | Table name |
String | column | Blob column name |
IEnumerable<String> | tablePrimaryKey | Table primary key columns |
IComparable[] | primaryKeyValue | Table primary key values |
String | nativeSqlType | Native SQL type name |
Returns
Type | Description |
---|---|
Query | Query |
GetAcquireXmlQuery(String, String, String[], IComparable[])
Returns query to acquire XML data
Declaration
Query GetAcquireXmlQuery(string table, string column, string[] tablePrimaryKey, IComparable[] primaryKeyValue)
Parameters
Type | Name | Description |
---|---|---|
String | table | Table name |
String | column | XML column name |
String[] | tablePrimaryKey | Table primary key columns |
IComparable[] | primaryKeyValue | Table primary key values |
Returns
Type | Description |
---|---|
Query | Query |
GetAllQuery(IDataStructure)
Returns query to check compliance of all repository objects Hint: Used in XData LINQ expressions
Declaration
Query GetAllQuery(IDataStructure structure)
Parameters
Type | Name | Description |
---|---|---|
IDataStructure | structure | Structure metadata |
Returns
Type | Description |
---|---|
Query | Query |
GetAnyQuery(IDataStructure)
Returns query to check existence of repository objects Hint: Used in XData LINQ expressions
Declaration
Query GetAnyQuery(IDataStructure structure)
Parameters
Type | Name | Description |
---|---|---|
IDataStructure | structure | Structure metadata |
Returns
Type | Description |
---|---|
Query | Query |
GetBlobSizeQuery(String, String, String[], IComparable[])
Returns query to get Large Object size
Declaration
Query GetBlobSizeQuery(string table, string column, string[] tablePrimaryKey, IComparable[] primaryKeyValue)
Parameters
Type | Name | Description |
---|---|---|
String | table | Table name contained LOB |
String | column | LOB column name |
String[] | tablePrimaryKey | Primary key column names |
IComparable[] | primaryKeyValue | Primary key values |
Returns
Type | Description |
---|---|
Query | Query to get Large Object size |
GetCall(IDataStructure, String)
Returns stored procedure call definition
Declaration
StoredProcedure GetCall(IDataStructure dataStructure, string userName)
Parameters
Type | Name | Description |
---|---|---|
IDataStructure | dataStructure | Structure |
String | userName | User name |
Returns
Type | Description |
---|---|
StoredProcedure | Stored procedure definition |
GetClearQuery(IDataStructure)
Returns query to clear all repository objects
Declaration
Query GetClearQuery(IDataStructure structure)
Parameters
Type | Name | Description |
---|---|---|
IDataStructure | structure | Structure metadata |
Returns
Type | Description |
---|---|
Query | Query |
GetCountQuery(IDataStructure)
Returns query to select count of data objects in repository
Declaration
Query GetCountQuery(IDataStructure structure)
Parameters
Type | Name | Description |
---|---|---|
IDataStructure | structure | Structure metadata |
Returns
Type | Description |
---|---|
Query | Query |
GetDeleteQuery(IDataStructure, IDataObject, String, Boolean)
Returns query to delete data object
Declaration
Query GetDeleteQuery(IDataStructure structure, IDataObject data, string userName, bool ignoreConcurrency = true)
Parameters
Type | Name | Description |
---|---|---|
IDataStructure | structure | Structure metadata |
IDataObject | data | Data object instance |
String | userName | User name |
Boolean | ignoreConcurrency | Ignore concurrency flag |
Returns
Type | Description |
---|---|
Query | Query |
GetInsertQuery(IDataStructure, IDataObject, String, Boolean)
Returns query to insert data object
Declaration
Query GetInsertQuery(IDataStructure structure, IDataObject data, string userName, bool ignoreConcurrency = true)
Parameters
Type | Name | Description |
---|---|---|
IDataStructure | structure | Structure metadata |
IDataObject | data | Data object instance |
String | userName | User name |
Boolean | ignoreConcurrency | Ignore concurrency flag |
Returns
Type | Description |
---|---|
Query | Query |
GetLockQuery(IDataStructure)
Returns query to lock single data object
Declaration
Query GetLockQuery(IDataStructure structure)
Parameters
Type | Name | Description |
---|---|---|
IDataStructure | structure | Structure metadata |
Returns
Type | Description |
---|---|
Query | Query |
GetParameterName(String)
Formats field name as parameter name
Declaration
string GetParameterName(string fieldName)
Parameters
Type | Name | Description |
---|---|---|
String | fieldName | Field name |
Returns
Type | Description |
---|---|
String | Parameter name |
GetRefreshQuery(IDataStructure)
Returns query to refresh single data object
Declaration
Query GetRefreshQuery(IDataStructure structure)
Parameters
Type | Name | Description |
---|---|---|
IDataStructure | structure | Structure metadata |
Returns
Type | Description |
---|---|
Query | Query |
GetSafeConvertExpression(Type, Expression, Expression)
Safe convert expression
Declaration
Expression GetSafeConvertExpression(Type type, Expression dataRow, Expression fieldName)
Parameters
Type | Name | Description |
---|---|---|
Type | type | Type of expression |
Expression | dataRow | Data row expression |
Expression | fieldName | Field name expression |
Returns
Type | Description |
---|---|
Expression | Expression |
GetSaveBlobQuery(String, String, IEnumerable<String>, IComparable[], ref Byte[], String)
Returns query to save blob data
Declaration
Query GetSaveBlobQuery(string table, string column, IEnumerable<string> tablePrimaryKey, IComparable[] primaryKeyValue, ref byte[] body, string nativeSqlType = null)
Parameters
Type | Name | Description |
---|---|---|
String | table | Table name |
String | column | Blob column name |
IEnumerable<String> | tablePrimaryKey | Table primary key columns |
IComparable[] | primaryKeyValue | Table primary key values |
Byte[] | body | Blob body |
String | nativeSqlType | Native SQL type name |
Returns
Type | Description |
---|---|
Query | Query |
GetSaveXmlQuery(String, String, String[], IComparable[], ref String)
Returns query to save XML data
Declaration
Query GetSaveXmlQuery(string table, string column, string[] tablePrimaryKey, IComparable[] primaryKeyValue, ref string body)
Parameters
Type | Name | Description |
---|---|---|
String | table | Table name |
String | column | XML column name |
String[] | tablePrimaryKey | Table primary key columns |
IComparable[] | primaryKeyValue | Table primary key values |
String | body | Blob body |
Returns
Type | Description |
---|---|
Query | Query |
GetSelectQuery(IDataStructure, Boolean, Boolean)
Returns query to select data objects
Declaration
Query GetSelectQuery(IDataStructure structure, bool markProperties = false, bool doNotSkip = false)
Parameters
Type | Name | Description |
---|---|---|
IDataStructure | structure | Structure metadata |
Boolean | markProperties | Mark properties with comments |
Boolean | doNotSkip | Don't skip sources |
Returns
Type | Description |
---|---|
Query | Query |
GetUpdateQuery(IDataStructure, IDataObject, String, Boolean)
Returns query to update data object
Declaration
Query GetUpdateQuery(IDataStructure structure, IDataObject data, string userName, bool ignoreConcurrency = true)
Parameters
Type | Name | Description |
---|---|---|
IDataStructure | structure | Structure metadata |
IDataObject | data | Data object instance |
String | userName | User name |
Boolean | ignoreConcurrency | Ignore concurrency flag |
Returns
Type | Description |
---|---|
Query | Query |
Init(String, IConfiguration, String)
SQL builder initialization
Declaration
void Init(string context, IConfiguration config, string sequence)
Parameters
Type | Name | Description |
---|---|---|
String | context | |
IConfiguration | config | |
String | sequence |
SetQueryParameterValues(ref Query, SortedList<String, Object>)
Set query parameter values
Declaration
void SetQueryParameterValues(ref Query query, SortedList<string, object> paramValues)
Parameters
Type | Name | Description |
---|---|---|
Query | query | Query |
SortedList<String, Object> | paramValues | Parameter values |