Interface ISqlDialect
SQL方言接口
Namespace: DapperDal.Sql
Assembly: DapperDal.dll
Syntax
public interface ISqlDialect
Properties
| Improve this Doc View SourceBatchSeperator
表示批次分割的字符串
Declaration
string BatchSeperator { get; }
Property Value
Type | Description |
---|---|
System.String |
CloseQuote
表示右引号的字符
Declaration
char CloseQuote { get; }
Property Value
Type | Description |
---|---|
System.Char |
EmptyExpression
表示空表达式的字符串
Declaration
string EmptyExpression { get; }
Property Value
Type | Description |
---|---|
System.String |
OpenQuote
表示左引号的字符
Declaration
char OpenQuote { get; }
Property Value
Type | Description |
---|---|
System.Char |
ParameterPrefix
表示参数前缀的字符
Declaration
char ParameterPrefix { get; }
Property Value
Type | Description |
---|---|
System.Char |
SupportsMultipleStatements
是否支持多语句执行
Declaration
bool SupportsMultipleStatements { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Methods
| Improve this Doc View SourceGetColumnName(String, String, String)
生成字段名
Declaration
string GetColumnName(string prefix, string columnName, string alias)
Parameters
Type | Name | Description |
---|---|---|
System.String | prefix | 前缀 |
System.String | columnName | 字段名 |
System.String | alias | 字段别名 |
Returns
Type | Description |
---|---|
System.String | 字段名 |
GetIdentitySql(String)
生成包含主键条件的获取语句
Declaration
string GetIdentitySql(string tableName)
Parameters
Type | Name | Description |
---|---|---|
System.String | tableName | 数据库表名 |
Returns
Type | Description |
---|---|
System.String | SQL |
GetPagingSql(String, Int32, Int32, IDictionary<String, Object>)
生成分页SQL
Declaration
string GetPagingSql(string sql, int page, int resultsPerPage, IDictionary<string, object> parameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | sql | 原SQL |
System.Int32 | page | 页索引 |
System.Int32 | resultsPerPage | 每页条数 |
IDictionary<System.String, System.Object> | parameters | 参数 |
Returns
Type | Description |
---|---|
System.String | 新SQL |
GetSetSql(String, Int32, Int32, IDictionary<String, Object>)
生成区间SQL
Declaration
string GetSetSql(string sql, int firstResult, int maxResults, IDictionary<string, object> parameters)
Parameters
Type | Name | Description |
---|---|---|
System.String | sql | 原SQL |
System.Int32 | firstResult | 起始行数 |
System.Int32 | maxResults | 最大条数 |
IDictionary<System.String, System.Object> | parameters | 参数 |
Returns
Type | Description |
---|---|
System.String | 新SQL |
GetTableName(String, String, String)
生成表名
Declaration
string GetTableName(string schemaName, string tableName, string alias)
Parameters
Type | Name | Description |
---|---|---|
System.String | schemaName | 数据库架构 |
System.String | tableName | 数据库表名 |
System.String | alias | 数据库表别名 |
Returns
Type | Description |
---|---|
System.String | 表名 |
IsQuoted(String)
判断语句是否包含引号
Declaration
bool IsQuoted(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | 语句 |
Returns
Type | Description |
---|---|
System.Boolean | 是否包含引号 |
QuoteString(String)
语句添加引号
Declaration
string QuoteString(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | 原语句 |
Returns
Type | Description |
---|---|
System.String | 新语句 |
SelectLimit(String, Int32)
获取前N条的SQL
Declaration
string SelectLimit(string sql, int limit)
Parameters
Type | Name | Description |
---|---|---|
System.String | sql | 原SQL |
System.Int32 | limit | 指定前几条 |
Returns
Type | Description |
---|---|
System.String | 新SQL |
SetNolock(String)
SQL语句添加 WITH (NOLOCK)
Declaration
string SetNolock(string sql)
Parameters
Type | Name | Description |
---|---|---|
System.String | sql | SQL语句 |
Returns
Type | Description |
---|---|
System.String | 添加后SQL语句 |