mirror of
https://github.com/Fabio286/antares.git
synced 2025-06-05 21:59:22 +02:00
feat(MySQL): support to new mysql8 authentication, closes #45
This commit is contained in:
parent
71b4310117
commit
db4430609e
@ -60,7 +60,7 @@
|
|||||||
"keytar": "^7.3.0",
|
"keytar": "^7.3.0",
|
||||||
"moment": "^2.29.1",
|
"moment": "^2.29.1",
|
||||||
"mssql": "^6.2.3",
|
"mssql": "^6.2.3",
|
||||||
"mysql": "^2.18.1",
|
"mysql2": "^2.2.5",
|
||||||
"pg": "^8.5.1",
|
"pg": "^8.5.1",
|
||||||
"source-map-support": "^0.5.16",
|
"source-map-support": "^0.5.16",
|
||||||
"spectre.css": "^0.5.9",
|
"spectre.css": "^0.5.9",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
import mysql from 'mysql';
|
import mysql from 'mysql2';
|
||||||
import { AntaresCore } from '../AntaresCore';
|
import { AntaresCore } from '../AntaresCore';
|
||||||
import dataTypes from 'common/data-types/mysql';
|
import dataTypes from 'common/data-types/mysql';
|
||||||
|
|
||||||
@ -43,8 +43,8 @@ export class MySQLClient extends AntaresCore {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_getType (field) {
|
_getType (field) {
|
||||||
let name = this.types[field.type];
|
let name = this.types[field.columnType];
|
||||||
let length = field.length;
|
let length = field.columnLength;
|
||||||
|
|
||||||
if (['DATE', 'TIME', 'YEAR', 'DATETIME'].includes(name))
|
if (['DATE', 'TIME', 'YEAR', 'DATETIME'].includes(name))
|
||||||
length = field.decimals;
|
length = field.decimals;
|
||||||
@ -52,11 +52,12 @@ export class MySQLClient extends AntaresCore {
|
|||||||
if (name === 'TIMESTAMP')
|
if (name === 'TIMESTAMP')
|
||||||
length = 0;
|
length = 0;
|
||||||
|
|
||||||
if (name === 'CHAR' && field.charsetNr === 63)// if binary
|
if (field.charsetNr === 63) { // if binary
|
||||||
|
if (name === 'CHAR')
|
||||||
name = 'BINARY';
|
name = 'BINARY';
|
||||||
|
else if (name === 'VARCHAR')
|
||||||
if (name === 'VARCHAR' && field.charsetNr === 63)// if binary
|
|
||||||
name = 'VARBINARY';
|
name = 'VARBINARY';
|
||||||
|
}
|
||||||
|
|
||||||
if (name === 'BLOB') {
|
if (name === 'BLOB') {
|
||||||
switch (length) {
|
switch (length) {
|
||||||
@ -1232,10 +1233,9 @@ export class MySQLClient extends AntaresCore {
|
|||||||
name: field.orgName,
|
name: field.orgName,
|
||||||
alias: field.name,
|
alias: field.name,
|
||||||
orgName: field.orgName,
|
orgName: field.orgName,
|
||||||
schema: field.db,
|
schema: field.schema,
|
||||||
table: field.table,
|
table: field.table,
|
||||||
tableAlias: field.table,
|
tableAlias: field.table,
|
||||||
zerofill: field.zerofill,
|
|
||||||
orgTable: field.orgTable,
|
orgTable: field.orgTable,
|
||||||
type: type.name,
|
type: type.name,
|
||||||
length: type.length
|
length: type.length
|
||||||
|
Loading…
x
Reference in New Issue
Block a user