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); }
public SqlQueryBuilderExtension(ISqlBuilderFluentAdapter sqlAdapter, SqlBuilderFormatting formatting, Type typeTable, string tableNameRealOverride, IDictionary <string, object> parameters) { _sqlAdapter = sqlAdapter; _formatting = formatting; _typeTable = typeTable; _tableNameRealOverride = tableNameRealOverride; _parameters = parameters; }
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); }
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; }
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()); }
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(); }
public ClauseOperatorInput(ClauseInputOperator @operator, SqlBuilderFormatting formatting) { Operator = @operator; Formatting = formatting; }
public FluentSqlBuilder(SqlAdapterType sqlAdapterType, SqlBuilderFormatting formatting = SqlBuilderFormatting.None, string tableAlias = null) { DefineSqlAdapter(sqlAdapterType, typeof(TTable), formatting, tableAlias); DefineTargetToSelect(TargetToSelect.Common); DefineExtension(); }
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()); }