mirror of
https://github.com/grafana/grafana.git
synced 2025-09-23 18:52:33 +08:00
SQL: Migrate (MS/My/Postgres)SQL configuration pages from Angular to React (#51891)
* Migrate SQL configuration pages from angular to react * Move enums to types.ts and remove angular partials * remove es lint disables and update betterer instead * Fix automatically added type declarations * Bump wor.. betterer ;) * Export SecretInput component from grafana-ui * Fix A11y issues * Export SecretTextArea as well * Fix typo * Use const instead of var * Fix typo in doc * Add autoDetectFeatures to postgres config editor Co-authored-by: Dominik Prokop <dominik.prokop@grafana.com> Co-authored-by: Zoltán Bedi <zoltan.bedi@gmail.com>
This commit is contained in:
@ -184,12 +184,25 @@ export class PostgresDatasource extends DataSourceWithBackend<PostgresQuery, Pos
|
||||
});
|
||||
}
|
||||
|
||||
getVersion(): Promise<any> {
|
||||
return lastValueFrom(this._metaRequest("SELECT current_setting('server_version_num')::int/100"));
|
||||
async getVersion(): Promise<string> {
|
||||
const value = await lastValueFrom(this._metaRequest("SELECT current_setting('server_version_num')::int/100"));
|
||||
const results = value.data.results['meta'];
|
||||
if (results.frames) {
|
||||
// This returns number
|
||||
return results.frames[0].data?.values[0][0].toString();
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
getTimescaleDBVersion(): Promise<any> {
|
||||
return lastValueFrom(this._metaRequest("SELECT extversion FROM pg_extension WHERE extname = 'timescaledb'"));
|
||||
async getTimescaleDBVersion(): Promise<string[] | undefined> {
|
||||
const value = await lastValueFrom(
|
||||
this._metaRequest("SELECT extversion FROM pg_extension WHERE extname = 'timescaledb'")
|
||||
);
|
||||
const results = value.data.results['meta'];
|
||||
if (results.frames) {
|
||||
return results.frames[0].data?.values[0][0];
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
testDatasource(): Promise<any> {
|
||||
|
Reference in New Issue
Block a user