Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@minatojs/driver-mysql

Package Overview
Dependencies
Maintainers
2
Versions
58
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@minatojs/driver-mysql - npm Package Compare versions

Comparing version 2.3.6 to 2.4.1

20

lib/index.js

@@ -220,3 +220,5 @@ "use strict";

for (const key in fields) {
const { initial, nullable = true } = fields[key];
const { deprecated, initial, nullable = true } = fields[key];
if (deprecated)
continue;
const legacy = [key, ...fields[key].legacy || []];

@@ -276,3 +278,3 @@ const column = columns.find((info) => legacy.includes(info.COLUMN_NAME));

logger.info("auto creating table %c", name);
return this.queue(`CREATE TABLE ?? (${create.join(", ")}) COLLATE = ?`, [name, this.config.charset]);
return this.query(`CREATE TABLE ${(0, import_sql_utils.escapeId)(name)} (${create.join(", ")}) COLLATE = ${this.sql.escape(this.config.charset)}`);
}

@@ -285,4 +287,16 @@ const operations = [

logger.info("auto updating table %c", name);
await this.queue(`ALTER TABLE ?? ${operations.join(", ")}`, [name]);
await this.query(`ALTER TABLE ${(0, import_sql_utils.escapeId)(name)} ${operations.join(", ")}`);
}
const dropKeys = [];
this.migrate(name, {
error: logger.warn,
before: (keys) => keys.every((key) => columns.some((info) => info.COLUMN_NAME === key)),
after: (keys) => dropKeys.push(...keys),
finalize: async () => {
if (!dropKeys.length)
return;
logger.info("auto migrating table %c", name);
await this.query(`ALTER TABLE ${(0, import_sql_utils.escapeId)(name)} ${dropKeys.map((key) => `DROP ${(0, import_sql_utils.escapeId)(key)}`).join(", ")}`);
}
});
}

@@ -289,0 +303,0 @@ query(sql) {

8

package.json
{
"name": "@minatojs/driver-mysql",
"version": "2.3.6",
"version": "2.4.1",
"description": "MySQL Driver for Minato",

@@ -28,10 +28,10 @@ "main": "lib/index.js",

"peerDependencies": {
"@minatojs/core": "^2.2.2"
"@minatojs/core": "^2.3.1"
},
"devDependencies": {
"@minatojs/tests": "^1.4.0",
"@minatojs/tests": "^1.5.0",
"@types/mysql": "^2.15.21"
},
"dependencies": {
"@minatojs/sql-utils": "^4.0.2",
"@minatojs/sql-utils": "^4.0.3",
"@vlasky/mysql": "^2.18.6",

@@ -38,0 +38,0 @@ "cosmokit": "^1.4.1",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc