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

mjs-mysql-builder

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mjs-mysql-builder - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

4

package.json
{
"name": "mjs-mysql-builder",
"version": "1.0.3",
"version": "1.0.4",
"description": "Mysql query builder",
"main": "index.mjs",
"scripts": {
"test": "ms test",
"test": "npm run build && ms test",
"build": "flow-remove-types src/ -d build/",

@@ -9,0 +9,0 @@ "lint:check": "eslint ./ --ext .mjs",

@@ -43,5 +43,7 @@ ## Mysql query builder

.add('email', f => f.type('varchar(50)').notNull().unique())
.add('name', f => f.type('varchar(50)').nullable())
.add('name', f => f.type('varchar(50)').null())
.add('currency', f => f.enum('RUB', 'USD', 'EUR').notNull().default('RUB'))
.add('type', f => f.type('varchar(30)').index().using(INDEX_TYPES.BTREE))
.add('book_id', f => f.type('int(11)').notNull().foreign().references('books', 'id').onDelete(REFERENCE_OPTIONS.CASCADE))
.key('currency', 'type').unique().using(INDEX_TYPES.HASH)
/* You can get Schema string */

@@ -53,2 +55,18 @@ .build() // -> string

- This converts to
```sql
CREATE TABLE IF NOT EXISTS `users` (
`id` int(11) AUTO_INCREMENT NOT NULL ,PRIMARY KEY (`id`) ,
`email` varchar(50) NOT NULL UNIQUE ,
`name` varchar(50) NULL ,
`currency` enum('RUB', 'USD', 'EUR') NOT NULL DEFAULT 'RUB' ,
`type` varchar(30) ,
INDEX (`type`) USING BTREE ,
`book_id` int(11) NOT NULL ,
FOREIGN KEY (`book_id`) REFERENCES `books` (`id`) ON DELETE CASCADE ,
UNIQUE KEY (`currency`, `type`) USING HASH
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci
```
- Query builder

@@ -55,0 +73,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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