Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/task#12 add stats by specified time interval #14

Merged
merged 64 commits into from
Apr 7, 2022
Merged
Changes from 1 commit
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
a393720
#12 update project structure
bodynar Nov 24, 2021
1525d72
#12 add data project
bodynar Nov 24, 2021
eca4cc6
#12 update namespaces and test projects
bodynar Nov 24, 2021
993ba22
#12 move services and models to data project
bodynar Nov 24, 2021
4aca5ed
#12 add xml notation to data project
bodynar Nov 24, 2021
90f5889
#12 fix project configs
bodynar Nov 24, 2021
6365e01
#12 fix tests due project restructure
bodynar Dec 12, 2021
9996518
#12 add filter models and utils
bodynar Dec 12, 2021
7f77905
#12 add filter builder contract and implementation
bodynar Dec 12, 2021
2930505
#12 update ms filter builder
bodynar Dec 12, 2021
e018ef0
#12 add common asserts
bodynar Dec 12, 2021
de4b10d
#12 add ms filter builder tests
bodynar Dec 12, 2021
3f9aa52
#12 add build test, add filter triming
bodynar Dec 13, 2021
7bef9a8
#12 add Where to data provider, add tests
bodynar Dec 13, 2021
4c11d9b
#12 add todo marker
bodynar Dec 14, 2021
5a40fa9
#12 register filter builder as service
bodynar Dec 14, 2021
dc86f1e
#12 add gathering column names from filter, add tests for method
bodynar Dec 14, 2021
37d187f
#12 update test classes notation
bodynar Dec 14, 2021
968f210
#12 add important TODOs
bodynar Dec 14, 2021
dce7c8d
#12 include SqlScripts into solution
bodynar Dec 14, 2021
ba46235
#12 add checking existence of column in Where, add tests, update exis…
bodynar Dec 14, 2021
c02eb2c
#12 eject logic to project
bodynar Dec 19, 2021
31e3de1
#12 add xml notation
bodynar Dec 19, 2021
3bda142
#12 rename service interface
bodynar Dec 19, 2021
003cfc0
#12 rename contract implementation, add TODO to think
bodynar Dec 19, 2021
e6f534f
#12 exclude folders from project
bodynar Dec 19, 2021
eae7003
#12 move utils to another folder
bodynar Feb 17, 2022
27f2c82
#12 add table join classes
bodynar Feb 17, 2022
31b0176
#12 add complex column path attribute
bodynar Feb 17, 2022
0866141
#12 add select config for data provider, add complex query builder co…
bodynar Feb 17, 2022
ba2cb67
#12 fix using
bodynar Feb 17, 2022
dc88678
#12 add baseline for complex column builder for mssql
bodynar Feb 17, 2022
a5c40f5
#12 temp fix for tests
bodynar Feb 17, 2022
8b8e93c
#12 add baseline implement for select API data provider for mssql
bodynar Feb 17, 2022
b542431
#12 remove complexColumnPathAttribute properties
bodynar Mar 18, 2022
38ee346
#12 update tableJoinData model
bodynar Mar 18, 2022
9667c62
#12 update CompleColumnQueryBuilder API
bodynar Mar 18, 2022
653ae88
#12 partially implement mssql complex column query builder
bodynar Mar 18, 2022
210e443
#12 update sql data provider tests
bodynar Mar 18, 2022
4ae5b58
#12 partially add complex column path query builder tests
bodynar Mar 18, 2022
d11290e
#12 fix using complex column query builder API
bodynar Mar 18, 2022
4e0ba5a
#12 build filter for story record service
bodynar Mar 18, 2022
9d05d17
#12 use complex column model to represent selected column instead of …
bodynar Mar 22, 2022
fb17c98
#12 add ToString override for table join data
bodynar Mar 22, 2022
15f902f
#12 fix table join data build process, update types
bodynar Mar 22, 2022
b0ab5a7
#12 update mssql complex column path builder tests
bodynar Mar 22, 2022
6092666
#12 rename method, add test cases to implement
bodynar Mar 23, 2022
3a04108
#12 add complex column path builder todo, add new tests
bodynar Mar 24, 2022
52196c5
#12 update sql data provider select implementation
bodynar Mar 24, 2022
8e465df
#12 init properties by default
bodynar Apr 7, 2022
09fbfbe
#12 comment properties to implement later
bodynar Apr 7, 2022
8ad10f4
#12 add query options to configure db operations restrictions
bodynar Apr 7, 2022
5ee03ab
#12 add table join data method to form a mssql query part
bodynar Apr 7, 2022
a0657ef
#12 eject filter part to method
bodynar Apr 7, 2022
ab76884
#12 implement select data mssql provider method
bodynar Apr 7, 2022
32c5e08
#12 add tests for mssql data provider select method
bodynar Apr 7, 2022
d431173
#12 rename model, implement StoryRecordService.Get
bodynar Apr 7, 2022
bc649ee
#12 fix webapi namespace
bodynar Apr 7, 2022
7745a94
#12 fix other namespaces
bodynar Apr 7, 2022
ac6c139
#12 fix table join data query mapping
bodynar Apr 7, 2022
26e29ef
#12 fix story record service get models
bodynar Apr 7, 2022
661e6e7
#12 fix story record service get models
bodynar Apr 7, 2022
88b838c
#12 add api controller to get stats
bodynar Apr 7, 2022
fe1ae9d
#12 register new services & remove folder
bodynar Apr 7, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
#12 update sql data provider select implementation
  • Loading branch information
bodynar committed Mar 24, 2022
commit 52196c5b98a1be92f49da19b0651d195f81c6403
Original file line number Diff line number Diff line change
Expand Up @@ -352,28 +352,24 @@ public IEnumerable<TProjection> Select<TProjection>(SelectConfiguration configur

var builtFilter = FilterBuilder.Build(configuration.Filter);

filterSql = builtFilter.sqlCondition;
filterSql = $"WHERE {builtFilter.sqlCondition}";
filterArgs = builtFilter.sqlArguments;
}

// TODO: select handle
// 1. Get columns to select (without attribute)
// 2. For joins do not forget to make aliases and use in columns

var complexColumnData = ComplexColumnQueryBuilder.BuildComplexColumns<TProjection>(TableName);

var columns = "*";
var joinPart = "";

if (complexColumnData == null)
if (complexColumnData != null)
{
columns = string.Join($"{Environment.NewLine}, ", complexColumnData.Columns.Select(column => column.ToString()));

joinPart = string.Join(Environment.NewLine, complexColumnData.Joins.Select(joinData => joinData.ToQueryPart()));
}



IEnumerable<TProjection> entities = Enumerable.Empty<TProjection>();
var sqlQuery = $"SELECT {columns} FROM [{TableName}] {joinPart} WHERE {filterSql}";
var sqlQuery = $"SELECT {columns} FROM [{TableName}] {joinPart} {filterSql}";

using (var connection = DbConnectionFactory.CreateDbConnection())
{
Expand Down