This package has been deprecated
Author message:
DOES NOT WORK
mysql-types
0.1.8 • Public • Published
var mysqlType = require('mysql-types');
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 |
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
nonePackage Sidebar
Install
Weekly Downloads