Class SqlDialectBase
SQL方言基类
Inheritance
System.Object
SqlDialectBase
Namespace: DapperDal.Sql
Assembly: DapperDal.dll
Syntax
public abstract class SqlDialectBase : object, ISqlDialect
Properties
| Improve this Doc View SourceBatchSeperator
表示批次分割的字符串
Declaration
public virtual string BatchSeperator { get; }
Property Value
Type | Description |
---|---|
System.String |
Implements
| Improve this Doc View SourceCloseQuote
表示右引号的字符
Declaration
public virtual char CloseQuote { get; }
Property Value
Type | Description |
---|---|
System.Char |
Implements
| Improve this Doc View SourceEmptyExpression
表示空表达式的字符串
Declaration
public string EmptyExpression { get; }
Property Value
Type | Description |
---|---|
System.String |
Implements
| Improve this Doc View SourceOpenQuote
表示左引号的字符
Declaration
public virtual char OpenQuote { get; }
Property Value
Type | Description |
---|---|
System.Char |
Implements
| Improve this Doc View SourceParameterPrefix
表示参数前缀的字符
Declaration
public virtual char ParameterPrefix { get; }
Property Value
Type | Description |
---|---|
System.Char |
Implements
| Improve this Doc View SourceSupportsMultipleStatements
是否支持多语句执行
Declaration
public virtual bool SupportsMultipleStatements { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
Implements
Methods
| Improve this Doc View SourceGetColumnName(String, String, String)
生成字段名
Declaration
public virtual 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 | 字段名 |
Implements
| Improve this Doc View SourceGetIdentitySql(String)
生成包含主键条件的获取语句
Declaration
public abstract string GetIdentitySql(string tableName)
Parameters
Type | Name | Description |
---|---|---|
System.String | tableName | 数据库表名 |
Returns
Type | Description |
---|---|
System.String | SQL |
Implements
| Improve this Doc View SourceGetPagingSql(String, Int32, Int32, IDictionary<String, Object>)
生成分页SQL
Declaration
public abstract 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 |
Implements
| Improve this Doc View SourceGetSetSql(String, Int32, Int32, IDictionary<String, Object>)
生成区间SQL
Declaration
public abstract 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 |
Implements
| Improve this Doc View SourceGetTableName(String, String, String)
生成表名
Declaration
public virtual 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 | 表名 |
Implements
| Improve this Doc View SourceIsQuoted(String)
判断语句是否包含引号
Declaration
public virtual bool IsQuoted(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | 语句 |
Returns
Type | Description |
---|---|
System.Boolean | 是否包含引号 |
Implements
| Improve this Doc View SourceQuoteString(String)
语句添加引号
Declaration
public virtual string QuoteString(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value | 原语句 |
Returns
Type | Description |
---|---|
System.String | 新语句 |
Implements
| Improve this Doc View SourceSelectLimit(String, Int32)
获取前N条的SQL
Declaration
public virtual string SelectLimit(string sql, int limit)
Parameters
Type | Name | Description |
---|---|---|
System.String | sql | 原SQL |
System.Int32 | limit | 指定前几条 |
Returns
Type | Description |
---|---|
System.String | 新SQL |
Implements
| Improve this Doc View SourceSetNolock(String)
SQL语句添加 WITH (NOLOCK)
Declaration
public virtual string SetNolock(string sql)
Parameters
Type | Name | Description |
---|---|---|
System.String | sql | SQL语句 |
Returns
Type | Description |
---|---|
System.String | 添加后SQL语句 |
Implements
| Improve this Doc View SourceUnQuoteString(String)
Declaration
public virtual string UnQuoteString(string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | value |
Returns
Type | Description |
---|---|
System.String |