mirror of
https://github.com/strapi/strapi.git
synced 2025-11-03 03:17:11 +00:00
alias version
This commit is contained in:
parent
952a05514f
commit
11d6f7803c
@ -3,7 +3,7 @@
|
||||
const { MARIADB, MYSQL } = require('../../utils/constants');
|
||||
|
||||
const SQL_QUERIES = {
|
||||
VERSION: `SELECT version()`,
|
||||
VERSION: `SELECT version() as version`,
|
||||
};
|
||||
|
||||
class MysqlDatabaseInspector {
|
||||
@ -13,7 +13,7 @@ class MysqlDatabaseInspector {
|
||||
|
||||
async getInformation() {
|
||||
const [results] = await this.db.connection.raw(SQL_QUERIES.VERSION);
|
||||
const version = results[0]['version()'];
|
||||
const version = results[0].version;
|
||||
|
||||
const [versionNumber, databaseName] = version.split('-');
|
||||
const database = databaseName && databaseName.toLowerCase() === 'mariadb' ? MARIADB : MYSQL;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
const { POSTGRES } = require('../../utils/constants');
|
||||
|
||||
const SQL_QUERIES = {
|
||||
VERSION: `SELECT current_setting('server_version')`,
|
||||
VERSION: `SELECT current_setting('server_version') as version`,
|
||||
};
|
||||
|
||||
class PostgresqlDatabaseInspector {
|
||||
@ -13,7 +13,7 @@ class PostgresqlDatabaseInspector {
|
||||
|
||||
async getInformation() {
|
||||
const { rows } = await this.db.connection.raw(SQL_QUERIES.VERSION);
|
||||
const version = rows[0].current_setting;
|
||||
const version = rows[0].version;
|
||||
|
||||
return {
|
||||
database: POSTGRES,
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
const { SQLITE } = require('../../utils/constants');
|
||||
|
||||
const SQL_QUERIES = {
|
||||
VERSION: `SELECT sqlite_version()`,
|
||||
VERSION: `SELECT sqlite_version() as version`,
|
||||
};
|
||||
|
||||
class SqliteDatabaseInspector {
|
||||
@ -13,7 +13,7 @@ class SqliteDatabaseInspector {
|
||||
|
||||
async getInformation() {
|
||||
const results = await this.db.connection.raw(SQL_QUERIES.VERSION);
|
||||
const version = results[0]['sqlite_version()'];
|
||||
const version = results[0].version;
|
||||
|
||||
return {
|
||||
database: SQLITE,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user