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.7.0 to 2.7.1

14

lib/index.js

@@ -45,10 +45,10 @@ "use strict";

var DEFAULT_DATE = /* @__PURE__ */ new Date("1970-01-01");
function getIntegerType(length = 11) {
if (length <= 4)
function getIntegerType(length = 4) {
if (length <= 1)
return "tinyint";
if (length <= 6)
if (length <= 2)
return "smallint";
if (length <= 9)
if (length <= 3)
return "mediumint";
if (length <= 11)
if (length <= 4)
return "int";

@@ -70,5 +70,9 @@ return "bigint";

case "integer":
if ((length || 0) > 8)
logger.warn(`type ${type}(${length}) exceeds the max supported length`);
return getIntegerType(length);
case "primary":
case "unsigned":
if ((length || 0) > 8)
logger.warn(`type ${type}(${length}) exceeds the max supported length`);
return `${getIntegerType(length)} unsigned`;

@@ -75,0 +79,0 @@ case "decimal":

{
"name": "@minatojs/driver-mysql",
"version": "2.7.0",
"version": "2.7.1",
"description": "MySQL Driver for Minato",

@@ -29,3 +29,3 @@ "main": "lib/index.js",

"peerDependencies": {
"@minatojs/core": "^2.6.0"
"@minatojs/core": "^2.6.1"
},

@@ -32,0 +32,0 @@ "devDependencies": {

@@ -18,7 +18,7 @@ import { createPool, format } from '@vlasky/mysql'

function getIntegerType(length = 11) {
if (length <= 4) return 'tinyint'
if (length <= 6) return 'smallint'
if (length <= 9) return 'mediumint'
if (length <= 11) return 'int'
function getIntegerType(length = 4) {
if (length <= 1) return 'tinyint'
if (length <= 2) return 'smallint'
if (length <= 3) return 'mediumint'
if (length <= 4) return 'int'
return 'bigint'

@@ -35,5 +35,9 @@ }

case 'boolean': return 'bit'
case 'integer': return getIntegerType(length)
case 'integer':
if ((length || 0) > 8) logger.warn(`type ${type}(${length}) exceeds the max supported length`)
return getIntegerType(length)
case 'primary':
case 'unsigned': return `${getIntegerType(length)} unsigned`
case 'unsigned':
if ((length || 0) > 8) logger.warn(`type ${type}(${length}) exceeds the max supported length`)
return `${getIntegerType(length)} unsigned`
case 'decimal': return `decimal(${precision}, ${scale}) unsigned`

@@ -40,0 +44,0 @@ case 'char': return `char(${length || 255})`

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