Commit Graph

339 Commits

Author SHA1 Message Date
Sven Klemm
e780b1bce5 cleanup where segment handling 2018-03-11 12:06:54 +01:00
Sven Klemm
0b358ff5f3 remove limit 2018-03-10 22:39:42 +01:00
Sven Klemm
cb5278d413 handle variables in where constraints 2018-03-10 20:18:03 +01:00
Sven Klemm
1d8540ac69 properly quote where constraint parts 2018-03-09 18:18:12 +01:00
Sven Klemm
340f679d0f quote schema and table 2018-03-09 18:09:59 +01:00
Sven Klemm
83200c289a use metricColumn in query builder 2018-03-04 23:32:23 +01:00
Sven Klemm
bf4a30d30f set rawSQL when rendering query builder query 2018-03-04 19:46:11 +01:00
Sven Klemm
26e09b598c fix group by column 2018-03-04 19:35:43 +01:00
Sven Klemm
e8c6341fed clean up aggregation functions 2018-03-04 10:18:11 +01:00
Sven Klemm
7104e6f9f8 fix variable interpolation 2018-03-03 22:11:51 +01:00
Sven Klemm
fd518846b1 rename field to column 2018-03-03 20:57:00 +01:00
Sven Klemm
c5de5ed5be Merge remote-tracking branch 'upstream/master' into postgres-query-builder 2018-02-21 08:24:04 +01:00
Daniel Lee
6fa46d9539 plugins: update meta data for all core plugins
So that the readme's can be published on Grafana.com
2018-02-15 16:50:38 +01:00
Carl Bergquist
fcca578f41 updates readmes for mysql and postgres (#10913)
ref #10813
2018-02-15 09:38:39 +01:00
Sven Klemm
ef18eb7fcb add where constraint handling 2018-02-08 10:25:32 +01:00
Sven Klemm
3bce45d8a6 add query_builder 2018-02-08 10:19:43 +01:00
Sven Klemm
382a525477 make metricColumn functional 2018-02-03 18:26:57 +01:00
Sven Klemm
c65a964cdd add metric column selector 2018-02-03 18:03:00 +01:00
Sven Klemm
4dbd83fac1 add groupby to querybuilder
remove unused aggregations
2018-01-31 15:32:32 +01:00
Sven Klemm
571ecdc740 enhance render function 2018-01-30 22:57:38 +01:00
Sven Klemm
443504517a add postgres_query.ts 2018-01-30 22:13:55 +01:00
Sven Klemm
438b10bcd6 query builder changes 2018-01-30 14:10:38 +01:00
Sven Klemm
a59e052a0f more query builder components 2018-01-30 14:08:10 +01:00
Sven Klemm
17be31e216 call render in query 2018-01-28 22:16:51 +01:00
Sven Klemm
33ac22bfdb start query builder ui 2018-01-21 22:08:18 +01:00
Torkel Ödegaard
27835f373e cleanup: removed unused typescript typings import 2018-01-04 10:12:02 +01: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
ce809de1ed postgres: change $__timeGroup macro to include "AS time" column alias (#10119)
* change $__timeGroup macro to include column alias

* update docs and help text for $__timeGroup macro
2017-12-08 15:14:10 +01:00
Sven Klemm
b44c599410 postgres: pass timerange for template variable queries (#10069)
* pass timerange for template queries when refresh is set to timerange
change

* document on time range change refresh mode for template queries
2017-12-07 10:05:04 +01:00
Sven Klemm
108f582ec4 sync documentation, add remark about to_timestamp and redshift (#9841) 2017-11-14 11:33:55 +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
Daniel Lee
e541e60bc3 sql: remove title from annotation help
Fixes #9710
2017-10-29 20:03:23 +01:00
Sven Klemm
34da0711ab add __timeGroup macro for mysql (#9596)
* add __timeGroup macro for mysql

* put example __timeGroup query in frontend help

* do __timeGroup interval parsing in go similar to mysql

* ignore whitespace around interval
2017-10-27 11:26:25 +02:00
Sven Klemm
56e53b8343 dont quote variables for mysql and postgres datasource (#9611) 2017-10-24 14:05:41 +02:00
Sven Klemm
b2d880c6de modify $__timeGroup macro so it can be used in select clause (#9527)
* modify $__timeGroup macro so it can be used in select clause

* fix $__interval_ms for postgres datasource

* use $__timeGroup macro in documentation

* fix annotation template query
remove title since its no longer used and add tags instead

* change __timeFilter macro to work on postgresql < 8.1 and redshift
2017-10-18 18:10:01 +02:00
Daniel Lee
7713009caa postgres: add missing ngInject decorator 2017-10-11 09:15:55 +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