42 Commits

Author SHA1 Message Date
cb0e80e7b9 TemplateVariables: Introduces $__searchFilter to Query Variables (#19858)
* WIP: Initial hardcoded version

* Feature: Introduces SearchFiltering to Graphite

* Feature: Adds searchFiltering to MySql

* Tests: Adds tests to Graphite and MySql

* Feature: Adds $__searchFilter to TestData

* Refactor: Adds searchFilter to Postgres and extracts function

* Tests: Adds tests to variable

* Refactor: Adds debounce and lodash import optimization

* Docs: Adds documentation

* Refactor: Removes unused function and fixes typo

* Docs: Updates docs

* Fixed issue with UI not updating when no  was used due to async func and no .apply in the non lazy path
2019-10-18 11:40:08 +02:00
96046a7ba6 MySQL, Postgres, MSSQL: Fix validating query with template variables in alert (#19237)
Adds support for validating query in alert for mysql, 
postgres and mssql.

Fixes #13155
2019-09-24 20:46:07 +02:00
0ef4060b98 Chore: Fix about 200 noImplicitAny errors (#18067)
* Fix 200 ish errors

* Add interface
2019-07-16 11:35:42 +02:00
3f15170914 Refactor: move some files to @grafana/data (#17952)
* moving to data WIP

* more refactoring

* add missing test

* mock full path

* remove sinon from grafana-ui
2019-07-06 08:05:53 +02:00
4e27ba9646 noImplicitAny: Sub 3000 errors (#17821)
* noImplicitAny Stackdriver

* Sub 3000 noImplicitAny

* Update error count limit

* Add DataQueryRequest type
2019-07-01 11:11:57 +02:00
ceb9f0855b Chore: Replaces moment with Grafanas DateTime (#16919)
* Wip: Initial commit

* Refactor: Replaces moment.utc(

* Refactor: replaces the last isMoment statements

* Refactor: Removes almost all moment imports

* Refactor: Moves moment_wrapper to grafana/ui

* Refactor: Renames momentWrapper

* Refactor: Removes one more moment import

* Refactor: Removes unitOfTime import

* Fix: Fixes Prettier error

* Refactor: Renames DateTimeType to DateTime

* Refactor: Renames isDateTimeType to isDateTime

* Refactor: Renames dateTime to dateTime

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