public TableWhereExpresionVisitor(IDialectProvider dialectProvider, IDictionary <string, object> parameters, ModelDefinition modelDefinition) : base(dialectProvider, parameters) { _modelDefinition = modelDefinition; }
internal TypedWhereStatement(IDialectProvider dialectProvider) { _dialectProvider = dialectProvider; _modelDefinition = ModelDefinition <T> .Definition; WhereStatement.TableName = _dialectProvider.GetQuotedTableName(_modelDefinition); }
/// <summary> /// Initializes a new instance of the NServiceKit.OrmLite.JoinSqlBuilder<TNewPoco, /// TBasePoco> class. /// </summary> public JoinSqlBuilder(IDialectProvider dialectProvider) { _dialectProvider = dialectProvider; basePocoType = typeof(TBasePoco); baseSchema = GetSchema(basePocoType); baseTableName = basePocoType.GetModelDefinition().ModelName; }
public ColumnWhereExpresionVisitor(IDialectProvider dialectProvider, IDictionary <string, object> parameters, string statement) : base(dialectProvider, parameters) { _statement = statement; }
/// <summary> /// Initializes a new instance of the OrmLiteConnection class. /// </summary> /// <param name="connection">The inner Connection</param> /// <param name="dialectProvider">The dialect provider</param> internal OrmConnection(DbConnection connection, IDialectProvider dialectProvider, ILoggerFactory loggerFactory) { _loggerFactory = loggerFactory; DialectProvider = dialectProvider; DbConnection = connection; _logger = loggerFactory.CreateLogger <OrmConnection>(); }
public TableWFieldsExpresionVisitor(IDialectProvider dialectProvider, IDictionary <string, object> parameters, ModelDefinition modelDefinition, bool addAliasSpecification) : base(dialectProvider, parameters) { _modelDefinition = modelDefinition; _addAliasSpecification = addAliasSpecification; }
public TypedSelectStatement(IDialectProvider dialectProvider) : base(dialectProvider) { _dialectProvider = dialectProvider; _modelDefinition = ModelDefinition <T> .Definition; Statement.TableName = _dialectProvider.GetQuotedTableName(_modelDefinition); Statement.Columns.AddRange(_dialectProvider.GetColumnNames(_modelDefinition)); }
public static ConnectionFactory CreateInstance(string connectionString, bool autDisposeConnection, IDialectProvider dialectProvider) { if (cf == null) { cf = new ConnectionFactory(connectionString, autDisposeConnection, dialectProvider); } return(cf); }
public void Can_Select_using_object_Array_Contains([ValueSource(typeof(MyDataClass), nameof(MyDataClass.Dialectproviders))] IDialectProvider _dialectProvider) { var vals = new object[] { TestEnum.Val0, TestEnum.Val1 }; var visitor1 = _dialectProvider.ExpressionVisitor <TestType2>(); visitor1.Where(q => vals.Contains(q.EnumCol) || vals.Contains(q.EnumCol)); var sql1 = _dialectProvider.ToSelectStatement(visitor1, CommandFlags.None); var visitor2 = _dialectProvider.ExpressionVisitor <TestType2>(); visitor2.Where(q => Sql.In(q.EnumCol, vals) || Sql.In(q.EnumCol, vals)); var sql2 = _dialectProvider.ToSelectStatement(visitor2, CommandFlags.None); Assert.AreEqual(sql1.CommandText, sql2.CommandText); }
public MySqlExpressionVisitor(IDialectProvider dialectProvider) : base(dialectProvider) { }
public OrmConnectionFactory(IDialectProvider dialectProvider, string connectionString) { _dialectProvider = dialectProvider; _connectionString = connectionString; }
protected ExpressionTests(IDialectProvider dialectProvider, string connectionString) { _connectionFactory = new OrmConnectionFactory(dialectProvider, connectionString); _connectionFactory.LoggerFactory = new ConsoleLoggerFactory(); }
public TypedDeleteStatement(IDialectProvider dialectProvider) : base(dialectProvider) { _dialectProvider = dialectProvider; }
public OrmConnectionFactory(IDialectProvider dialectProvider, string connectionString) { DialectProvider = dialectProvider; _connectionString = connectionString; LoggerFactory = new DummyLoggerFactory(); }
public PostgreSQLExpressionVisitor(IDialectProvider dialectProvider) : base(dialectProvider) { }
protected ExpressionVisitor(IDialectProvider dialectProvider, IDictionary <string, object> parameters) { DialectProvider = dialectProvider; Parameters = parameters; }
/// <summary>Visit column access method.</summary> /// <param name="m">The MethodCallExpression to process.</param> /// <returns>An object.</returns> //protected override object VisitColumnAccessMethod(MethodCallExpression m) //{ // List<Object> args = this.VisitExpressionList(m.Arguments); // var quotedColName = Visit(m.Object); // string statement; // switch (m.Method.Name) // { // case "Substring": // var startIndex = Int32.Parse(args[0].ToString()) + 1; // if (args.Count == 2) // { // var length = Int32.Parse(args[1].ToString()); // statement = string.Format("substr({0}, {1}, {2})", quotedColName, startIndex, length); // } // else // statement = string.Format("substr({0}, {1})", quotedColName, startIndex); // break; // default: // return base.VisitColumnAccessMethod(m); // } // return new PartialSqlString(statement); //} /// <summary>Visit SQL method call.</summary> /// <exception cref="NotSupportedException">Thrown when the requested operation is not supported.</exception> /// <param name="m">The MethodCallExpression to process.</param> /// <returns>An object.</returns> //protected override object VisitSqlMethodCall(MethodCallExpression m) //{ // List<Object> args = this.VisitExpressionList(m.Arguments); // object quotedColName = args[0]; // args.RemoveAt(0); // var statement = ""; // switch (m.Method.Name) // { // case "In": // var member = Expression.Convert(m.Arguments[1], typeof(object)); // var lambda = Expression.Lambda<Func<object>>(member); // var getter = lambda.Compile(); // var inArgs = Sql.Flatten(getter() as IEnumerable); // var sIn = new StringBuilder(); // foreach (var e in inArgs) // { // sIn.AppendFormat("{0}{1}", // sIn.Length > 0 ? "," : "", // Config.DialectProvider.GetQuotedValue(e, e.GetType())); // } // statement = string.Format("{0} {1} ({2})", quotedColName, m.Method.Name, sIn); // break; // case "Desc": // statement = string.Format("{0} DESC", quotedColName); // break; // case "As": // statement = string.Format("{0} As {1}", quotedColName, // Config.DialectProvider.GetQuotedColumnName(RemoveQuoteFromAlias(args[0].ToString()))); // break; // case "Sum": // case "Count": // case "Min": // case "Max": // case "Avg": // statement = string.Format("{0}({1}{2})", // m.Method.Name, // quotedColName, // args.Count == 1 ? string.Format(",{0}", args[0]) : ""); // break; // default: // throw new NotSupportedException(); // } // return new PartialSqlString(statement); //} public SqliteExpressionVisitor(IDialectProvider dialectProvider) : base(dialectProvider) { }
public DynamicCountStatement(IDialectProvider dialectProvider) { _dialectProvider = dialectProvider; }
///// <summary> ///// Initializes a new instance of the OrmLiteConnection class. ///// </summary> ///// <param name="connection"></param> ///// <param name="dialectProvider"></param> internal OrmConnection(DbConnection connection, IDialectProvider dialectProvider) { DialectProvider = dialectProvider; DbConnection = connection; }
public ConnectionFactory(string connectionString, IDialectProvider dialectProvider) : this(connectionString, true, dialectProvider) { }
public TypedInsertStatement(IDialectProvider dialectProvider) { _dialectProvider = dialectProvider; Statement.TableName = _dialectProvider.GetQuotedTableName(_modelDefinition); Statement.HasIdentity = _modelDefinition.FieldDefinitions.Any(x => x.AutoIncrement); }
public TypedUpdateStatement(IDialectProvider dialectProvider) : base(dialectProvider) { _dialectProvider = dialectProvider; Statement.TableName = _dialectProvider.GetQuotedTableName(_modelDefinition); }
public DynamicSelectStatement(IDialectProvider dialectProvider) : base(dialectProvider) { }
public ConnectionFactory(string connectionString, bool autoDisposeConnection, IDialectProvider dialectProvider) { ConnectionString = connectionString; AutoDisposeConnection = autoDisposeConnection; if (dialectProvider != null) { Config.DialectProvider = dialectProvider; } }
protected ExpressionTests(IDialectProvider dialectProvider) { _dialectProvider = dialectProvider; //BasicConfigurator.Configure(new DebugAppender{Layout = new SimpleLayout()}); }