This package has been deprecated

Author message:

DOES NOT WORK

mysql-types

0.1.8 • Public • Published

Usage

var mysqlType = require('mysql-types');

Conversions

JS Type MySQL Type
string VARCHAR (automatically converted to TEXT when adding more characters)
number SMALLINT
boolean TINYINT(1)
date DATETIME
function tries if function is constructor and uses type of instance else Error
object Error
array Error

Examples

let string = mysqlType('string') // VARCHAR
let string = mysqlType(String) // VARCHAR

let number = mysqlType(123) // SMALLINT
let number = mysqlType(Number) // SMALLINT

let date = mysqlType(new Date()) // DATETIME
let date = mysqlType(Date) // DATETIME

let bool = mysqlType(true) // TINYINT(1)
let bool = mysqlType(Boolean) // TINYINT(1)

Readme

Keywords

none

Package Sidebar

Install

npm i mysql-types

Weekly Downloads

0

Version

0.1.8

License

MIT

Last publish

Collaborators

  • ties_s