Commit Graph

36 Commits

Author SHA1 Message Date
Sven Klemm
116fb50530 Fix query builder queries for interval start
This changes the rate and increase queries to not calculate
a value when there is no previous value. This also adds an
order by metric column to prevent inconsistent series ordering
in the legend.
2018-09-08 08:28:15 +02:00
Patrick O'Carroll
25f13bd3ad added only-arrow-functions rule and changed files to follow new rule (#13154) 2018-09-05 15:28:30 +02:00
Patrick O'Carroll
0f326f18dc changed functions to arrowfunctions for only-arrow-functions rule (#13127) 2018-09-04 15:55:41 +02:00
Sven Klemm
de917dfc4d Merge branch 'master' into postgres-query-builder 2018-09-03 13:43:58 +02:00
Patrick O'Carroll
b8d82df97e added no-angle-bracket-type-assertion rule and updatet files to follow rule (#13115) 2018-09-03 11:30:44 +02:00
Sven Klemm
265d5daf57 Merge branch 'master' into postgres-query-builder 2018-08-31 19:02:46 +02:00
Sven Klemm
a87b27c7d3 check for correct quoting of multiple singlequotes 2018-08-29 16:50:59 +02:00
Sven Klemm
7177f19436 Merge branch 'master' into postgres-query-builder 2018-08-27 11:23:55 +02:00
Torkel Ödegaard
9b978b7203
tslint: autofix of let -> const (#13033) 2018-08-26 17:14:40 +02:00
Sven Klemm
18ce6fc280 use unixEpochGroup macro for unix timestamp 2018-08-18 12:04:32 +02:00
Sven Klemm
735c4abe6c rename postgres_query.jest.ts to .test.ts 2018-08-15 12:06:32 +02:00
Sven Klemm
5b3b0295e8 Merge branch 'master' into postgres-query-builder 2018-08-14 15:10:16 +02:00
Tobias Skarhed
a65589a5fb Rename test files 2018-08-14 10:52:41 +02:00
Sven Klemm
aa830211fe dont order for aggregate 2018-08-03 10:15:28 +02:00
Sven Klemm
0b57e88f9e adjust frontend test 2018-08-03 06:19:53 +02:00
Sven Klemm
67edb9e9fe Merge remote-tracking branch 'upstream/master' into postgres-query-builder 2018-08-02 16:39:27 +02:00
Brice Maron
bb7e583863 fix custom variable quoting in sql* query interpolations 2018-08-01 20:32:50 +02:00
Sven Klemm
5327580939 refactor column function handling 2018-07-28 21:41:23 +02:00
Sven Klemm
6ca7a03975 consistent nameing fro group and select 2018-07-28 12:53:36 +02:00
Sven Klemm
97f24733f5 remove tableschema from query builder ui 2018-07-27 10:58:08 +02:00
Sven Klemm
7af9cd7dfc set explicit order for rate and increase 2018-07-22 15:20:40 +02:00
Sven Klemm
0e608a08c2 fix test for query generation 2018-07-15 22:58:25 +02:00
Sven Klemm
d9648f1fe7 fix bug in query generation with metricColumn 2018-07-15 09:43:38 +02:00
Sven Klemm
fa66645b0f refactor PostgresQuery 2018-07-15 09:36:49 +02:00
Sven Klemm
d0c2b19c51 Add templateSrv to PostgresQuery tests 2018-07-14 11:05:35 +02:00
Sven Klemm
b745fab190 add tests for query generation 2018-07-13 22:29:10 +02:00
Sven Klemm
17591ca29f fix tests for postgres datasource 2018-07-13 10:15:55 +02:00
Tobias Skarhed
74bf80962d Add mock to test files 2018-07-04 14:32:22 +02:00
Tobias Skarhed
962340bcd1 Create new instance in beforeEach 2018-07-04 14:32:22 +02:00
Tobias Skarhed
3bbe39c5ad Karma to Jest: postgres datasource 2018-07-04 14:30:36 +02:00
Torkel Ödegaard
3a1f52d8a2 prettier: ran on all files again, sorry. now settings are defined in package.json 2017-12-21 08:39:31 +01:00
Torkel Ödegaard
85879a7014 prettier: change to single quoting 2017-12-20 12:33:33 +01:00
Torkel Ödegaard
fadfc665e4 tech: ran pretttier on all typescript files 2017-12-19 16:06:54 +01:00
Sven Klemm
caa8b6100e always quote template variables for postgres when multi-value or include (#9714)
all is allowed
2017-10-31 12:23:21 +01:00
Sven Klemm
56e53b8343 dont quote variables for mysql and postgres datasource (#9611) 2017-10-24 14:05:41 +02:00
Daniel Lee
d1c9760fa8 Postgres Data Source (#9475)
* add postgresql datasource

* add rest of files for postgres datasource

* fix timeseries query, remove unused code

* consistent naming, refactoring

* s/mysql/postgres/

* s/mysql/postgres/

* couple more tests

* tests for more datatypes

* fix macros for postgres

* add __timeSec macro

* add frontend for postgres datasource

* adjust documentation

* fix formatting

* add proper plugin description

* merge editor changes from mysql

* port changes from mysql datasource

* set proper defaultQuery for postgres

* add time_sec to timeseries query
accept int for value for timeseries query

* revert allowing time_sec and handle int or float values as unix
timestamp for "time" column

* fix tslint error

* handle decimal values in timeseries query

* allow setting sslmode for postgres datasource

* use type switch for handling data types

* fix value for timeseries query

* refactor timeseries queries to make them more flexible

* remove debug statement from inner loop in type conversion

* use plain for loop in getTypedRowData

* fix timeseries queries

* adjust postgres datasource to tsdb refactoring

* adjust postgres datasource to frontend changes

* update lib/pq to latest version

* move type conversion to getTypedRowData

* handle address types cidr, inet and macaddr

* adjust response parser and docs for annotations

* convert unknown types to string

* add documentation for postgres datasource

* add another example query with metric column

* set more helpful default query

* update help text in query editor

* handle NULL in value column of timeseries query

* add __timeGroup macro

* add test for __timeGroup macro

* document __timeGroup and set proper default query for annotations

* fix typos in docs

* add postgres to list of datasources

* add postgres to builtInPlugins

* mysql: refactoring as prep for merging postgres

Refactors out the initialization of the xorm engine and the query logic
for an sql data source.

* mysql: rename refactoring + test update

* postgres:refactor to use SqlEngine(same as mysql)

Refactored to use a common base class with the MySql data source.

Other changes from the original PR:
- Changed time column to be time_sec to allow other time units in the
future and to be the same as MySQL
- Changed integration test to test the main Query method rather than
the private transformToTable method
- Changed the __timeSec macro name to __timeEpoch
- Renamed PostgresExecutor to PostgresQueryEndpoint

Fixes #9209 (the original PR)

* postgres: encrypt password on config page

With some other cosmetic changes to the config page:
- placeholder texts
- reset button for the password after it has been encrypted.
- default value for the sslmode field.

* postgres: change back col name to time from time_sec

* postgres mysql: remove annotation title

Title has been removed from annotations

* postgres: fix images for docs page

* postgres mysql: fix specs
2017-10-10 15:19:14 +02:00