Skip to content

Commit cc82b46

Browse files
authored
Merge pull request #76 from d4software/develop
Merging Develop
2 parents 39c1268 + c088967 commit cc82b46

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2389
-2288
lines changed

.circleci/config.yml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@ version: 2
22
jobs:
33
build:
44
docker:
5-
- image: microsoft/aspnetcore-build:2.0-stretch
5+
- image: microsoft/dotnet:2.2-sdk-stretch
66
steps:
77
- checkout
8-
- run: npm install less -g
98
- run: dotnet build ./Web/QueryTree.csproj -v n
109
test:
1110
docker:
12-
- image: microsoft/aspnetcore-build:2.0-stretch
11+
- image: microsoft/dotnet:2.2-sdk-stretch
1312
steps:
1413
- checkout
15-
- run: npm install less -g
1614
- run: dotnet test ./Tests/Tests.csproj -v n
1715
docker-publish:
1816
machine: true
@@ -44,4 +42,4 @@ workflows:
4442
- docker-publish:
4543
requires:
4644
- test
47-
- build
45+
- build

Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
FROM microsoft/aspnetcore-build:2.0-stretch as builder
1+
FROM microsoft/dotnet:2.2-sdk-stretch as builder
22
WORKDIR /build
33
COPY . .
4-
RUN npm install less -g
54
RUN dotnet restore
6-
RUN dotnet publish -c Release ./Web/QueryTree.csproj -o /dist
5+
RUN dotnet publish --no-restore -c Release ./Web/QueryTree.csproj -o /dist
76

8-
9-
FROM microsoft/aspnetcore:2.0-stretch as runtime
7+
FROM microsoft/dotnet:2.2-aspnetcore-runtime as runtime
108
WORKDIR /app
119
COPY --from=builder /dist .
1210
COPY ./Web/EmailTemplates ./EmailTemplates

Engine/Engine.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.0</TargetFramework>
4+
<TargetFramework>netcoreapp2.2</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

Engine/NodeBase.cs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -217,13 +217,6 @@ public string GetFetchDataQuery(int? startRow = null, int? rowCount = null)
217217
{
218218
var query = new StringBuilder();
219219

220-
if (DatabaseType == DatabaseType.SQLServer || DatabaseType == DatabaseType.PostgreSQL)
221-
{
222-
IList<NodeBase> nodes = new List<NodeBase>();
223-
FetchOrderedDependencies(nodes);
224-
query.Append(BuildWithSql(nodes));
225-
}
226-
227220
if (DatabaseType == DatabaseType.MySQL)
228221
{
229222
query.AppendFormat("SELECT {0} FROM ({1} ORDER BY {2}) AS results",
@@ -238,6 +231,10 @@ public string GetFetchDataQuery(int? startRow = null, int? rowCount = null)
238231
}
239232
else if (DatabaseType == DatabaseType.SQLServer || DatabaseType == DatabaseType.PostgreSQL)
240233
{
234+
IList<NodeBase> nodes = new List<NodeBase>();
235+
FetchOrderedDependencies(nodes);
236+
query.Append(BuildWithSql(nodes));
237+
241238
if (startRow.HasValue && rowCount.HasValue)
242239
{
243240
// In order for this to work, we will need a ROW_NUMBER column in the CTE, which we

README.md

Lines changed: 50 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Supports customization of the logo image, system name and CSS used
1919
within the app.
2020

2121
Can use either Sqlite or Microsoft SQL Server database for it's own user
22-
and reports data storage.
22+
and reports data storage.
2323

2424
Database and SSH passwords are stored in its database in encryped form,
2525
using AES encryption. Users may provide their own key file, or let the
@@ -42,67 +42,56 @@ for more information.
4242
- [Running the Tests](#running-the-tests)
4343
- [Running with Docker](/docs/docker.md)
4444

45-
### Running from Source
46-
47-
To run QueryTree from it's source code, you need the [.NET Core SDK](https://www.microsoft.com/net/download) and [NPM](https://nodejs.org/) installed.
45+
### Prerequisites
4846

49-
You will need to install the Less.js compiler using NPM:
47+
To build binaries or run from source you need the [.NET Core SDK v2.2](https://www.microsoft.com/net/download) installed.
5048

51-
```
52-
npm install less -g
53-
```
49+
### Running from Source
5450

55-
Then follow these steps:
51+
Check you have the prerequisites installed, then follow these steps:
5652

5753
1. Clone this repo into a folder
5854

5955
2. At the command prompt, cd into the folder, then into the "Web" folder.
6056

6157
3. Type:
62-
58+
6359
```sh
6460
dotnet run
6561
```
66-
67-
4. Visit [http://localhost:5000/](http://localhost:5000/) in your browser. You should see the QueryTree application. *Dotnet may decide to run it on a different port if 5000 is not available, check your terminal output.
6862

69-
If you would like to run QueryTree with your own local development settings, you can add a Web/usersettings.json file containing a modified copy of appsettings.json. Settings in this file will override appsettings.json. However, this file will be ignored by git.
63+
4. Dotnet should report that the applicaiton is running, e.g.
7064

71-
### Building Binaries
65+
```sh
66+
Now listening on: http://localhost:54182
67+
Application started. Press Ctrl+C to shut down.
68+
```
7269

73-
You may need to build a release binary to be run with the [.NET Core 2.0.x runtime](https://www.microsoft.com/net/download/core#/runtime). These binaries can be used on systems without the full .NET Core SDK. To build the initial binaries you need the [.NET Core SDK](https://www.microsoft.com/net/download) and [NPM](https://nodejs.org/) installed.
70+
Visit the URL shown in your browser. You should see the QueryTree application.
7471

75-
You will need to install the Less.js compiler using NPM:
72+
If you would like to run QueryTree with your own local development settings, you can add a Web/usersettings.json file containing a modified copy of appsettings.json. Settings in this file will override appsettings.json. However, this file will be ignored by git.
7673

77-
```
78-
npm install less -g
79-
```
74+
### Building Binaries
8075

8176
To build a release binary from the project root execute:
8277

83-
```
78+
```sh
8479
dotnet publish -c Release ./Web/QueryTree.csproj -o ./dist
8580
```
8681

8782
This will create a release folder in `dist` of all the unpacked QueryTree binaries and its dependencies.
8883

89-
9084
### Running from Binaries
9185

92-
QueryTree is built using .NET Core. To run QueryTree on your server
93-
you will need to install the .NET Core 2.0.x runtime. You can download
94-
the installer [here](https://www.microsoft.com/net/download/core#/run).
86+
To run QueryTree on your server you will need to install the .NET Core 2.2.x runtime. (It is not necessary to install the full .NET SDK, just the runtime.) You can download the installer [here](https://www.microsoft.com/net/download/core#/runtime).
9587

96-
To verify that you have the .NET runtime installed, open a terminal/cmd
97-
window and type
88+
To verify that you have the .NET runtime installed, open a terminal/cmd window and type
9889

99-
```
90+
```sh
10091
dotnet --version
10192
```
10293

10394
If the command returns a version number, you're ready to run QueryTree.
104-
If not, please visit [https://www.microsoft.com/net/download/core#/runtime](https://www.microsoft.com/net/download/core#/runtime)
105-
and follow the instructions for your platform.
10695

10796
Once the dotnet runtime is installed, follow these steps:
10897

@@ -112,11 +101,18 @@ Once the dotnet runtime is installed, follow these steps:
112101

113102
3. At the command prompt, type:
114103

115-
```
104+
```sh
116105
dotnet QueryTree.dll
117106
```
118107

119-
4. Visit [http://localhost:5000/](http://localhost:5000/) in your browser. You should see the QueryTree application.
108+
4. Dotnet should report that the applicaiton is running, e.g.
109+
110+
```sh
111+
Now listening on: http://localhost:5000
112+
Application started. Press Ctrl+C to shut down.
113+
```
114+
115+
Visit the URL shown in your browser. You should see the QueryTree application.
120116

121117
5. For use in production environments, QueryTree should be run behind a reverse proxy such as nginx. For more information on hosting QueryTree using nginx see: https://docs.microsoft.com/en-us/aspnet/core/publishing/linuxproduction
122118

@@ -125,9 +121,10 @@ in IIS see: https://docs.microsoft.com/en-us/aspnet/core/publishing/iis
125121

126122
### Running the Tests
127123

128-
To run the automated tests in this project, cd into the "Tests" folder, then type:
124+
To run the automated tests in this project, from the project root folder, type the following:
129125

130-
```
126+
```sh
127+
cd Tests
131128
dotnet test
132129
```
133130

@@ -137,82 +134,63 @@ See the full Docker guide: [docs/docker.md](/docs/docker.md)
137134

138135
## Getting Started
139136

140-
1. When first run, QueryTree will have no users and no database connections. Visiting
141-
app, you will be presented with a login page:
137+
1. When first run, QueryTree will have no users and no database connections. Visiting app, you will be presented with a login page:
142138

143139
![The QueryTree login page](http://querytreeapp.com/img/screenshots/querytree-login.png "The QueryTree login page")
144140

145141
2. Click the "Sign up as a new user" button, and enter your details to create a new account.
146142

147143
![The QueryTree signup page](http://querytreeapp.com/img/screenshots/querytree-signup.png "The QueryTree signup page")
148144

149-
3. Having signed in, you won't have any database connections configured. The system
150-
will ask you whether you want to set up a connection yourself, or invite another user
151-
who might be able to do it for you.
145+
3. Having signed in, you won't have any database connections configured. The system will ask you whether you want to set up a connection yourself, or invite another user who might be able to do it for you.
152146

153147
![The QueryTree onboard page](http://querytreeapp.com/img/screenshots/querytree-onboarding.png "The QueryTree onboarding page")
154148

155-
4. Assuming you have a database that you can connect to, select the "+ Connect Database"
156-
option. You will see the Create Connection page:
149+
4. Assuming you have a database that you can connect to, select the "+ Connect Database" option. You will see the Create Connection page:
157150

158151
![The QueryTree create connection page](http://querytreeapp.com/img/screenshots/querytree-create-connection.png "The QueryTree create connection page")
159152

160-
Once all the information is entered, you can check the connection by pressing the
161-
"Test Connection" button. If the system reports that the conneciton is working,
162-
press "Save".
153+
Once all the information is entered, you can check the connection by pressing the "Test Connection" button. If the system reports that the conneciton is working, press "Save".
163154

164155
![The QueryTree test connection feature](http://querytreeapp.com/img/screenshots/querytree-test-connection.png "The QueryTree test connection feature")
165156

166-
5. You will be taken to the reports list for this connection, but there won't be
167-
any reports yet.
157+
5. You will be taken to the reports list for this connection, but there won't be any reports yet.
168158

169159
![The QueryTree reports page](http://querytreeapp.com/img/screenshots/querytree-reports-empty.png "The QueryTree reports page")
170160

171161
6. Click on "+ Create Report". You will be taken to the defualt report builder
172162

173-
7. All reports start by picking a datbase table to start from. From there
174-
the report builder will prompt you to select any related tables that it can
175-
join to. For example, in this screenshot, I have selected the "orders" table
176-
and QueryTree is prompting me to join the "users" table. QueryTree can see
177-
that "orders" has a link to "users" so it offers to join the tables.
163+
7. All reports start by picking a datbase table to start from. From there the report builder will prompt you to select any related tables that it can join to. For example, in this screenshot, I have selected the "orders" table and QueryTree is prompting me to join the "users" table. QueryTree can see that "orders" has a link to "users" so it offers to join the tables.
178164

179165
![The QueryTree create report page](http://querytreeapp.com/img/screenshots/querytree-create-report-orders.png "The QueryTree create report page")
180166

181-
For more information on how to help QueryTree automatically join between tables
182-
in your database see [QueryTree's Auto Join feature](/docs/autojoin.md)
167+
For more information on how to help QueryTree automatically join between tables in your database see [QueryTree's Auto Join feature](/docs/autojoin.md)
183168

184-
8. Having selected a starting table, and any relevant related tables, click Next.
185-
The filter panel will open and you will be prompted to add one or more Filters.
169+
8. Having selected a starting table, and any relevant related tables, click Next. The filter panel will open and you will be prompted to add one or more Filters.
186170

187171
![The QueryTree report filter panel](http://querytreeapp.com/img/screenshots/querytree-report-filter.png "The QueryTree report filter panel")
188172

189-
9. Once you are happy with the filters, you have the option to summarize the data
190-
that is being shown in the results panel. Summerizing the data can mean totaling,
191-
averaging, counting or finding the minimum/maximum values, for one or more columns.
192-
You can do this for all the data, or for different groups of values. For example,
193-
you could find the average value of the orders, for each country.
173+
9. Once you are happy with the filters, you have the option to summarize the data that is being shown in the results panel. summerizing the data can mean totaling, averaging, counting or finding the minimum/maximum values, for one or more columns. You can do this for all the data, or for different groups of values. For example, you could find the average value of the orders, for each country.
194174

195175
![The QueryTree report summerize panel](http://querytreeapp.com/img/screenshots/querytree-report-summerize.png "The QueryTree report summerize panel")
196176

197-
10. Finally, you have the option of generating a chart from the data in the results
198-
panel.
177+
10. Finally, you have the option of generating a chart from the data in the results panel.
199178

200179
![The QueryTree report chart panel](http://querytreeapp.com/img/screenshots/querytree-report-chart.png "The QueryTree report chart panel")
201180

202-
11. Once you are happy with your report, save it by clicking the Save button. You
203-
will be returned to the list of reports for this connection.
181+
11. Once you are happy with your report, save it by clicking the Save button. You will be returned to the list of reports for this connection.
204182

205183
## Other Guides
206184

207-
* [Scheduling Reports](/docs/scheduling.md)
208-
* [Sharing Individual Reports](/docs/sharing.md)
209-
* [Team Management](/docs/teams.md)
210-
* [The Advanced Query Builder](/docs/advanced.md)
211-
* [Auto Join](/docs/autojoin.md)
212-
* [Customizing QueryTree](/docs/customizing.md)
213-
* [Building a password manager](/docs/password-manager.md)
214-
* [Using with Docker](/docs/docker.md)
215-
* [Configuring Email](/docs/mail.md)
185+
- [Scheduling Reports](/docs/scheduling.md)
186+
- [Sharing Individual Reports](/docs/sharing.md)
187+
- [Team Management](/docs/teams.md)
188+
- [The Advanced Query Builder](/docs/advanced.md)
189+
- [Auto Join](/docs/autojoin.md)
190+
- [Customizing QueryTree](/docs/customizing.md)
191+
- [Building a password manager](/docs/password-manager.md)
192+
- [Using with Docker](/docs/docker.md)
193+
- [Configuring Email](/docs/mail.md)
216194

217195
## License
218196

Tests/Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFramework>netcoreapp2.0</TargetFramework>
4+
<TargetFramework>netcoreapp2.2</TargetFramework>
55
</PropertyGroup>
66

77
<ItemGroup>

0 commit comments

Comments
 (0)