This commit fixes the following unindent findings:
pkg/api/common.go:102:2: "if x { if y" should be "if x && y"
pkg/components/dynmap/dynmap.go:642:2: invert condition and early return
pkg/components/dynmap/dynmap.go:681:2: invert condition and early return
pkg/components/simplejson/simplejson.go:171:2: "if x { if y" should be "if x && y"
pkg/middleware/dashboard_redirect.go:42:3: invert condition and early return
pkg/tsdb/mssql/mssql.go:301:3: invert condition and early break
pkg/tsdb/mysql/mysql.go:312:3: invert condition and early break
pkg/tsdb/postgres/postgres.go:292:3: invert condition and early break
pkg/tsdb/sql_engine.go:144:2: invert condition and early return
This fixes:
build.go:553:6: should omit comparison to bool constant, can be simplified to !strings.Contains(path, ".sha256") (S1002)
pkg/cmd/grafana-cli/commands/ls_command.go:27:5: should omit comparison to bool constant, can be simplified to !pluginDirInfo.IsDir() (S1002)
pkg/components/dynmap/dynmap_test.go:24:5: should omit comparison to bool constant, can be simplified to !value (S1002)
pkg/components/dynmap/dynmap_test.go:122:14: should omit comparison to bool constant, can be simplified to b (S1002)
pkg/components/dynmap/dynmap_test.go:125:14: should omit comparison to bool constant, can be simplified to !b (S1002)
pkg/components/dynmap/dynmap_test.go:128:14: should omit comparison to bool constant, can be simplified to !b (S1002)
pkg/models/org_user.go:51:5: should omit comparison to bool constant, can be simplified to !(*r).IsValid() (S1002)
pkg/plugins/datasource/wrapper/datasource_plugin_wrapper_test.go:77:12: should omit comparison to bool constant, can be simplified to !haveBool (S1002)
pkg/services/alerting/conditions/evaluator.go:23:9: should omit comparison to bool constant, can be simplified to !reducedValue.Valid (S1002)
pkg/services/alerting/conditions/evaluator.go:48:5: should omit comparison to bool constant, can be simplified to !reducedValue.Valid (S1002)
pkg/services/alerting/conditions/evaluator.go:91:5: should omit comparison to bool constant, can be simplified to !reducedValue.Valid (S1002)
pkg/services/alerting/conditions/query.go:56:6: should omit comparison to bool constant, can be simplified to !reducedValue.Valid (S1002)
pkg/services/alerting/extractor.go:107:20: should omit comparison to bool constant, can be simplified to !enabled.MustBool() (S1002)
pkg/services/alerting/notifiers/telegram.go:222:41: should omit comparison to bool constant, can be simplified to this.UploadImage (S1002)
pkg/services/sqlstore/apikey.go:58:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/apikey.go:72:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/dashboard.go:66:33: should omit comparison to bool constant, can be simplified to !cmd.Overwrite (S1002)
pkg/services/sqlstore/dashboard.go:175:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/dashboard.go:311:13: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/dashboard.go:444:12: should omit comparison to bool constant, can be simplified to !exists (S1002)
pkg/services/sqlstore/dashboard.go:472:12: should omit comparison to bool constant, can be simplified to !exists (S1002)
pkg/services/sqlstore/dashboard.go:554:32: should omit comparison to bool constant, can be simplified to !cmd.Overwrite (S1002)
pkg/services/sqlstore/dashboard_snapshot.go:83:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/plugin_setting.go:39:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/quota.go:34:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/quota.go:111:6: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/quota.go:136:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/quota.go:213:6: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/temp_user.go:129:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:157:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:182:5: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:191:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:212:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/services/sqlstore/user.go:307:12: should omit comparison to bool constant, can be simplified to !has (S1002)
pkg/social/generic_oauth.go:185:5: should omit comparison to bool constant, can be simplified to !s.extractToken(&data, token) (S1002)
pkg/tsdb/mssql/mssql.go:148:39: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/mssql/mssql.go:212:6: should omit comparison to bool constant, can be simplified to !query.Model.Get("fillNull").MustBool(false) (S1002)
pkg/tsdb/mssql/mssql.go:247:56: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/mssql/mssql.go:274:7: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/mssql/mssql.go:282:8: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/mysql/mysql.go:221:6: should omit comparison to bool constant, can be simplified to !query.Model.Get("fillNull").MustBool(false) (S1002)
pkg/tsdb/mysql/mysql.go:256:56: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/mysql/mysql.go:283:7: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/mysql/mysql.go:291:8: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/postgres/postgres.go:134:39: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/postgres/postgres.go:201:6: should omit comparison to bool constant, can be simplified to !query.Model.Get("fillNull").MustBool(false) (S1002)
pkg/tsdb/postgres/postgres.go:236:56: should omit comparison to bool constant, can be simplified to ok (S1002)
pkg/tsdb/postgres/postgres.go:263:7: should omit comparison to bool constant, can be simplified to !exist (S1002)
pkg/tsdb/postgres/postgres.go:271:8: should omit comparison to bool constant, can be simplified to !exist (S1002)
Use the ConvertSqlTimeColumnToEpochMs function to convert any native
datetime data type or epoch time (millisecond precision).
Additional tests and update of existing due to timezone issues
running postgres on UTC and dev environment on non-utc.
Added test dashboard.
* 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
* 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
* 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