public classSQLLib
{private static readonly ConcurrentDictionary TypeTableName = new ConcurrentDictionary();private static readonly ConcurrentDictionary> KeyProperties = new ConcurrentDictionary>();private static readonly ConcurrentDictionary> TypeProperties = new ConcurrentDictionary>();private static readonly ConcurrentDictionary> ExplicitKeyProperties = new ConcurrentDictionary>();///
///sql体系///
public enumSQLDialect
{
SQLServerOld= 0,
PostgreSQL= 1,
SQLite= 2,
MySQL= 3,
SQLServerNew= 4,
}///
///返回分页模板///
///
///
public static stringGetPaginationTemplate(SQLDialect dialect)
{switch(dialect)
{caseSQLDialect.PostgreSQL://_encapsulation = "\"{0}\"";//_getIdentitySql = string.Format("SELECT LASTVAL() AS id");
return "Select {SelectColumns} from {TableName} {WhereClause} Order By {OrderBy} LIMIT {RowsPerPage} OFFSET (({PageNumber}-1) * {RowsPerPage});";//break;
caseSQLDialect.SQLite://_encapsulation = "\"{0}\"";//_getIdentitySql = string.Format("SELECT LAST_INSERT_ROWID() AS id");
return "Select {SelectColumns} from {TableName} {WhereClause} Order By {OrderBy} LIMIT {RowsPerPage} OFFSET (({PageNumber}-1) * {RowsPerPage});";//break;
caseSQLDialect.MySQL://_encapsulation = "`{0}`";//_getIdentitySql =