コード例 #1
0
        private void DefineSqlAdapter(SqlAdapterType sqlAdapterType, Type typeTable, SqlBuilderFormatting formatting, string tableAlias)
        {
            var sqlAdapter = GetInstanceSqlAdapter(sqlAdapterType);

            _sqlQueryBuilder = new FluentSqlQueryBuilder(sqlAdapter, typeTable, formatting, null, tableAlias);
            _resolver        = new LambdaResolver(_sqlQueryBuilder, tableAlias);
        }
コード例 #2
0
 public SqlQueryBuilderExtension(ISqlBuilderFluentAdapter sqlAdapter, SqlBuilderFormatting formatting, Type typeTable, string tableNameRealOverride, IDictionary <string, object> parameters)
 {
     _sqlAdapter            = sqlAdapter;
     _formatting            = formatting;
     _typeTable             = typeTable;
     _tableNameRealOverride = tableNameRealOverride;
     _parameters            = parameters;
 }
コード例 #3
0
        public FluentSqlQueryBuilder(ISqlBuilderFluentAdapter sqlAdapter, Type typeTable, SqlBuilderFormatting formatting, IParameterNameStrategy parameterNameStrategy = null, string tableNameAliasOverride = null)
        {
            _sqlAdapter = sqlAdapter;
            _formatting = formatting;

            DefineTableNameAliasOverride(tableNameAliasOverride);
            DefineSqlQueryBuilderExtension(typeTable);

            _sqlQueryBuilderExtension.DefineTableNameFrom(typeTable);
            _sqlQueryBuilderExtension.DefineSchemaNameFrom(typeTable);
            _sqlQueryBuilderExtension.DefineParameterNameStrategy(parameterNameStrategy);
        }
コード例 #4
0
 public SqlServerSelectBuildInput(string columns, int?limit, string schemaTable, string tableName, string tableNameAlias, string joins, string where, string order, string grouping, string having, SqlBuilderFormatting formatting)
 {
     _columns        = columns;
     _limit          = limit;
     _schemaTable    = schemaTable;
     _tableName      = tableName;
     _tableNameAlias = tableNameAlias;
     _joins          = joins;
     _where          = where;
     _order          = order;
     _grouping       = grouping;
     _having         = having;
     _formatting     = formatting;
 }
コード例 #5
0
        public string GetSelectString(string columns, int?limit, string schemaTable, string tableName, string tableNameAlias, string joins, string where, string order, string grouping, string having, SqlBuilderFormatting formatting)
        {
            var sqlServerSelectBuildInput = new SqlServerSelectBuildInput(columns, limit, schemaTable, tableName, tableNameAlias, joins, where, order, grouping, having, formatting);

            return(sqlServerSelectBuildInput.ToString());
        }
コード例 #6
0
 public virtual string GetSelectPaginationString(string columns, string schemaName, string tableName, string tableNameAlias, string joins, string where, string order, string grouping, string having, int pageSize, int pageNumber, SqlBuilderFormatting formatting)
 {
     throw new NotImplementedException();
 }
コード例 #7
0
 public ClauseOperatorInput(ClauseInputOperator @operator, SqlBuilderFormatting formatting)
 {
     Operator   = @operator;
     Formatting = formatting;
 }
コード例 #8
0
 public FluentSqlBuilder(SqlAdapterType sqlAdapterType, SqlBuilderFormatting formatting = SqlBuilderFormatting.None, string tableAlias = null)
 {
     DefineSqlAdapter(sqlAdapterType, typeof(TTable), formatting, tableAlias);
     DefineTargetToSelect(TargetToSelect.Common);
     DefineExtension();
 }
コード例 #9
0
        public override string GetSelectPaginationString(string columns, string schemaName, string tableName, string tableNameAlias, string joins, string where, string order, string grouping, string having, int pageSize, int pageNumber, SqlBuilderFormatting formatting)
        {
            var rowNumber = pageSize * (pageNumber - 1);
            var sqlServerSelectBuildInput = new SqlServerSelectBuildInput(columns, null, schemaName, tableName, tableNameAlias, joins, where, order, grouping, having, formatting);
            var offsetToAdd = $"OFFSET {rowNumber} ROWS FETCH NEXT {pageSize} ROWS ONLY";

            sqlServerSelectBuildInput.AddSqlBottom(offsetToAdd);

            return(sqlServerSelectBuildInput.ToString());
        }