-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathSqliteDialect.cs
More file actions
47 lines (40 loc) · 1.48 KB
/
Copy pathSqliteDialect.cs
File metadata and controls
47 lines (40 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System.Collections.Generic;
using DapperRepository.Drapper.Sql;
namespace DapperRepository.SQLite
{
internal class SqliteDialect : SqlDialectBase
{
public override char OpenQuote
{
get { return '`'; }
}
public override char CloseQuote
{
get { return '`'; }
}
public override string GetIdentitySql(string tableName)
{
return "SELECT LAST_INSERT_ROWID()";
}
public override string GetPagingSql(string sql, int page, int resultsPerPage, IDictionary<string, object> parameters)
{
int startValue = page * resultsPerPage;
return GetSetSql(sql, startValue, resultsPerPage, parameters);
}
public override string GetSetSql(string sql, int firstResult, int maxResults, IDictionary<string, object> parameters)
{
string result = string.Format("{0} LIMIT @firstResult, @maxResults", sql);
parameters.Add("@firstResult", firstResult);
parameters.Add("@maxResults", maxResults);
return result;
}
public override string GetColumnName(string prefix, string columnName, string alias)
{
return base.GetColumnName(null, columnName, alias);
}
public override string GetTableName(string schemaName, string tableName, string alias)
{
return base.GetTableName(null, tableName, alias);
}
}
}