Type mysql configs
This commit is contained in:
parent
d9a38b0908
commit
f10a66cc42
|
@ -20,18 +20,11 @@ import { NUMBER_REGEX } from "../utilities"
|
||||||
import Sql from "./base/sql"
|
import Sql from "./base/sql"
|
||||||
import { MySQLColumn } from "./base/types"
|
import { MySQLColumn } from "./base/types"
|
||||||
|
|
||||||
const mysql = require("mysql2/promise")
|
import mysql from "mysql2/promise"
|
||||||
|
|
||||||
interface MySQLConfig {
|
export interface MySQLConfig extends mysql.ConnectionOptions {
|
||||||
host: string
|
|
||||||
port: number
|
|
||||||
user: string
|
|
||||||
password: string
|
|
||||||
database: string
|
database: string
|
||||||
ssl?: { [key: string]: any }
|
|
||||||
rejectUnauthorized: boolean
|
rejectUnauthorized: boolean
|
||||||
typeCast: Function
|
|
||||||
multipleStatements: boolean
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const SCHEMA: Integration = {
|
const SCHEMA: Integration = {
|
||||||
|
@ -134,7 +127,8 @@ class MySQLIntegration extends Sql implements DatasourcePlus {
|
||||||
if (
|
if (
|
||||||
config.rejectUnauthorized != null &&
|
config.rejectUnauthorized != null &&
|
||||||
!config.rejectUnauthorized &&
|
!config.rejectUnauthorized &&
|
||||||
config.ssl
|
config.ssl &&
|
||||||
|
typeof config.ssl !== "string"
|
||||||
) {
|
) {
|
||||||
config.ssl.rejectUnauthorized = config.rejectUnauthorized
|
config.ssl.rejectUnauthorized = config.rejectUnauthorized
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue