Esempio n. 1
0
 public QueryBuilder(AdoAdapter adoAdapter, int bulkIndex)
 {
     _adoAdapter = adoAdapter;
     _bulkIndex = bulkIndex;
     _schema = _adoAdapter.GetSchema();
     _commandBuilder = new CommandBuilder(_schema, _bulkIndex);
     _simpleReferenceFormatter = new SimpleReferenceFormatter(_schema, _commandBuilder);
 }
Esempio n. 2
0
 public QueryBuilder(AdoAdapter adoAdapter, int bulkIndex)
 {
     _adoAdapter               = adoAdapter;
     _bulkIndex                = bulkIndex;
     _schema                   = _adoAdapter.GetSchema();
     _commandBuilder           = new CommandBuilder(_schema, _bulkIndex);
     _simpleReferenceFormatter = new SimpleReferenceFormatter(_schema, _commandBuilder);
 }
Esempio n. 3
0
 protected QueryBuilderBase(AdoAdapter adapter, int bulkIndex, IFunctionNameConverter functionNameConverter)
 {
     _adoAdapter = adapter;
     _bulkIndex = bulkIndex;
     _schema = _adoAdapter.GetSchema();
     _commandBuilder = new CommandBuilder(_schema, _bulkIndex);
     _simpleReferenceFormatter = new SimpleReferenceFormatter(_schema, _commandBuilder, functionNameConverter);
 }
 protected QueryBuilderBase(AdoAdapter adapter, int bulkIndex, IFunctionNameConverter functionNameConverter)
 {
     _adoAdapter               = adapter;
     _bulkIndex                = bulkIndex;
     _schema                   = _adoAdapter.GetSchema();
     _commandBuilder           = new CommandBuilder(_schema, _bulkIndex);
     _simpleReferenceFormatter = new SimpleReferenceFormatter(_schema, _commandBuilder, functionNameConverter);
 }
        private string CreateColumnUpdateClause(string columnName, object value, Table table)
        {
            var    column        = table.FindColumn(columnName);
            var    mathReference = value as SimpleReference;
            string rightOperand;

            if (ReferenceEquals(mathReference, null))
            {
                rightOperand = _commandBuilder.AddParameter(value, column).Name;
            }
            else
            {
                rightOperand =
                    new SimpleReferenceFormatter(_schema, _commandBuilder).FormatColumnClauseWithoutAlias(mathReference);
            }


            return(string.Format("{0} = {1}", column.QuotedName, rightOperand));
        }
 public ExpressionFormatter(ICommandBuilder commandBuilder, DatabaseSchema schema)
 {
     _commandBuilder = commandBuilder;
     _schema = schema;
     _simpleReferenceFormatter = new SimpleReferenceFormatter(_schema, _commandBuilder);
 }
Esempio n. 7
0
 public ExpressionFormatter(ICommandBuilder commandBuilder, DatabaseSchema schema)
 {
     _commandBuilder           = commandBuilder;
     _schema                   = schema;
     _simpleReferenceFormatter = new SimpleReferenceFormatter(_schema, _commandBuilder);
 }
Esempio n. 8
0
        private string CreateColumnUpdateClause(string columnName, object value, Table table)
        {
            var column = table.FindColumn(columnName);
            var mathReference = value as SimpleReference;
            string rightOperand;
            if (ReferenceEquals(mathReference, null))
            {
                rightOperand = _commandBuilder.AddParameter(value, column).Name;
            }
            else
            {
                rightOperand =
                    new SimpleReferenceFormatter(_schema, _commandBuilder).FormatColumnClauseWithoutAlias(mathReference);
            }


            return string.Format("{0} = {1}", column.QuotedName, rightOperand);
        }
Esempio n. 9
0
 public QueryBuilder(AdoAdapter adoAdapter)
 {
     _adoAdapter = adoAdapter;
     _schema = _adoAdapter.GetSchema();
     _simpleReferenceFormatter = new SimpleReferenceFormatter(_schema);
 }