Skip to content

Commit

Permalink
fix(mysql): fix mysql package
Browse files Browse the repository at this point in the history
  • Loading branch information
burgerni10 committed Apr 17, 2023
1 parent 3d2218c commit cf7391b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/south/south-sql/south-sql.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import path from 'node:path'

import db from 'better-sqlite3'
import mssql from 'mssql'
import mysql from 'mysql2/promise'
import { createConnection } from 'mysql2/promise'
import * as pg from 'pg'
import { DateTime } from 'luxon'
import humanizeDuration from 'humanize-duration'
Expand Down Expand Up @@ -296,7 +296,7 @@ export default class SouthSQL extends SouthConnector {
let connection = null
let data = []
try {
connection = await mysql.createConnection(config)
connection = await createConnection(config)

const params = generateReplacementParameters(this.query, startTime, endTime)
const [rows] = await connection.execute(
Expand Down
6 changes: 3 additions & 3 deletions src/south/south-sql/south-sql.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import mysql from 'mysql2/promise'
import { createConnection } from 'mysql2/promise'
import { Client } from 'pg'
import mssql from 'mssql'

Expand Down Expand Up @@ -37,7 +37,7 @@ describe('MySQL Integration test', () => {
}

beforeAll(async () => {
const connection = await mysql.createConnection(mysqlConfig)
const connection = await createConnection(mysqlConfig)
await connection.query('CREATE TABLE IF NOT EXISTS history (temperature double, created_at datetime)')

await connection.query('INSERT INTO history (temperature, created_at) '
Expand All @@ -49,7 +49,7 @@ describe('MySQL Integration test', () => {
})

afterAll(async () => {
const connection = await mysql.createConnection(mysqlConfig)
const connection = await createConnection(mysqlConfig)
await connection.query('DROP TABLE history')
await connection.end()
})
Expand Down

0 comments on commit cf7391b

Please sign in to comment.