本文整理汇总了C#中ISqlDialect类的典型用法代码示例。如果您正苦于以下问题:C# ISqlDialect类的具体用法?C# ISqlDialect怎么用?C# ISqlDialect使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ISqlDialect类属于命名空间,在下文中一共展示了ISqlDialect类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DropTableWriter
public DropTableWriter(ISqlDialect dialect) {
if (dialect == null) {
throw new ArgumentNullException("dialect");
}
this.dialect = dialect;
}
示例2: ToSql
public static string ToSql(this DateTime value, ISqlDialect dialect = null)
{
if (value.Date == value)
return value.ToString((dialect ?? SqlSettings.DefaultDialect).DateFormat, Invariants.DateTimeFormat);
return value.ToString((dialect ?? SqlSettings.DefaultDialect).DateTimeFormat, Invariants.DateTimeFormat);
}
示例3: DelimitedDbStatement
public DelimitedDbStatement(
ISqlDialect dialect,
TransactionScope scope,
IDbConnection connection,
IDbTransaction transaction)
: base(dialect, scope, connection, transaction)
{}
示例4: InheritedSqlPersistenceEngine
public InheritedSqlPersistenceEngine(
IConnectionFactory connectionFactory,
ISqlDialect dialect,
ISerialize serializer,
TransactionScopeOption scopeOption, int pageSize)
: base(connectionFactory, dialect, serializer, scopeOption, pageSize)
{}
示例5: ToString
public string ToString(ISqlDialect dialect)
{
var sql = new StringBuilder();
sql.AppendFormat("delete from {0}", table);
if (where != Exp.Empty) sql.AppendFormat(" where {0}", where.ToString(dialect));
return sql.ToString();
}
示例6: ToSql
public static string ToSql(this string value, ISqlDialect dialect = null)
{
if (value == null)
return Null;
return (dialect ?? SqlSettings.DefaultDialect).QuoteUnicodeString(value);
}
示例7: ReverseEngineer
public IEnumerable<IMap> ReverseEngineer(
DatabaseSchema schema,
ISqlDialect sqlDialect,
IEnumerable<string> tablesToIgnore,
IAnswerProvider answerProvider,
bool fixOneToOnes) {
if (tablesToIgnore == null) {
tablesToIgnore = new string[0];
}
var maps = new List<IMap>();
this.configuration = new Configuration(sqlDialect);
foreach (var table in schema.Tables.Where(t => !tablesToIgnore.Contains(t.Name))) {
maps.Add(this.MapTable(table));
}
// go back through and add indexes and foreign keys
foreach (var map in maps) {
GetIndexesAndForeignKeys(schema.Tables.First(t => t.Name == map.Table), map);
}
// go back through and try to spot one-to-one columns
if (fixOneToOnes) {
foreach (var map in maps) {
FindOneToOnes(map, answerProvider);
}
}
return maps;
}
示例8: ToString
public override string ToString(ISqlDialect dialect)
{
return string.Format("{0} {1} {2}",
column1.ToString(dialect),
Not ? "<>" : "=",
column2.ToString(dialect));
}
示例9: Append
public void Append(StringBuilder stringBuilder, ISqlDialect dialect) {
if (this.Node != null) {
stringBuilder.Append(this.Node.Alias).Append(".");
}
dialect.AppendQuotedName(stringBuilder, this.columnName);
}
示例10: ForConnection
public ICreateSessionFactory ForConnection(string connectionName, ISqlDialect sqlDialect, IDbDriver dbDriver)
{
if (connectionName == null)
{
throw new ArgumentNullException("connectionName");
}
if (sqlDialect == null)
{
throw new ArgumentNullException("sqlDialect");
}
if (dbDriver == null)
{
throw new ArgumentNullException("dbDriver");
}
var configSection = ConfigurationManager.ConnectionStrings[connectionName];
if (configSection == null)
{
throw new ConfigurationException(ExceptionMessages.FluentConfiguration_ConnectionNotFound.FormatWith(connectionName));
}
this.chosenConnectionName = configSection.Name;
this.chosenSqlDialect = sqlDialect;
this.chosenDbDriver = dbDriver;
this.chosenDbDriver.ConnectionString = configSection.ConnectionString;
this.chosenDbDriver.DbProviderFactory = DbProviderFactories.GetFactory(configSection.ProviderName);
return this;
}
示例11: Dump
public static string Dump(string sql, IDictionary<string, object> parameters, ISqlDialect dialect = null)
{
if (parameters == null)
return sql;
var param = parameters.ToList();
for (var i = 0; i < param.Count; i++)
{
var name = param[i].Key;
if (!name.StartsWith("@"))
param[i] = new KeyValuePair<string,object>("@" + name, param[i].Value);
}
param.Sort((x, y) => y.Key.Length.CompareTo(x.Key.Length));
var sb = new StringBuilder(sql);
foreach (var pair in param)
sb.Replace(pair.Key, DumpParameterValue(pair.Value, dialect));
var text = DatabaseCaretReferences.Replace(sb.ToString());
dialect = dialect ?? SqlSettings.DefaultDialect;
var openBracket = dialect.OpenQuote;
if (openBracket != '[')
text = BracketLocator.ReplaceBrackets(text, dialect);
var paramPrefix = dialect.ParameterPrefix;
if (paramPrefix != '@')
text = ParamPrefixReplacer.Replace(text, paramPrefix);
return text;
}
示例12: SessionFactory
internal SessionFactory(string connectionName, IDbDriver dbDriver, ISqlDialect sqlDialect)
{
this.connectionName = connectionName;
this.dbDriver = dbDriver;
this.sqlDialect = sqlDialect;
this.sessionListeners = new SessionListeners(Listener.DeleteListeners, Listener.InsertListener, Listener.UpdateListeners);
}
示例13: DynamicSQLinqJoinExpression
/// <summary>
/// Creates a new DynamicSQLinqJoinExpression instance
/// </summary>
/// <param name="tableName">The database Table / View to Join</param>
/// <param name="joinOperator">The JOIN operator</param>
/// <param name="clause">The Join clause</param>
/// <param name="parameters">Any parameter values necessary for the Join clause</param>
public DynamicSQLinqJoinExpression(ISqlDialect dialect, string tableName, DynamicSQLinqJoinOperator joinOperator, string clause, object[] parameters)
{
this.Dialect = dialect;
this.Table = tableName;
this.JoinOperator = joinOperator;
this.Clause = clause;
this.Parameters = parameters;
}
示例14: FirebirdDbStatement
public FirebirdDbStatement(
ISqlDialect dialect,
IDbConnection connection,
IDbTransaction transaction,
params IDisposable[] resources)
: base(dialect, connection, transaction, resources)
{
}
示例15: CustomSqlPersistenceFactory
public CustomSqlPersistenceFactory(IConnectionFactory factory, ISerialize serializer, ISqlDialect dialect, TransactionScopeOption scopeOption, int pageSize) : base(factory, serializer, dialect, scopeOption, pageSize)
{
this.factory = factory;
this.serializer = serializer;
this.dialect = dialect;
this.scopeOption = scopeOption;
this.pageSize = pageSize;
}