UNPKG

sequelize

Version:

Multi dialect ORM for Node.JS/io.js

1,558 lines (1,557 loc) 1.23 MB
{ "type": "File", "start": 0, "end": 5115, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 192, "column": 0 } }, "program": { "type": "Program", "start": 0, "end": 5115, "loc": { "start": { "line": 1, "column": 0 }, "end": { "line": 192, "column": 0 } }, "sourceType": "module", "body": [ { "type": "VariableDeclaration", "start": 15, "end": 42, "loc": { "start": { "line": 3, "column": 0 }, "end": { "line": 3, "column": 27 } }, "declarations": [ { "type": "VariableDeclarator", "start": 21, "end": 41, "loc": { "start": { "line": 3, "column": 6 }, "end": { "line": 3, "column": 26 } }, "id": { "type": "Identifier", "start": 21, "end": 24, "loc": { "start": { "line": 3, "column": 6 }, "end": { "line": 3, "column": 9 }, "identifierName": "wkx" }, "name": "wkx" }, "init": { "type": "CallExpression", "start": 27, "end": 41, "loc": { "start": { "line": 3, "column": 12 }, "end": { "line": 3, "column": 26 } }, "callee": { "type": "Identifier", "start": 27, "end": 34, "loc": { "start": { "line": 3, "column": 12 }, "end": { "line": 3, "column": 19 }, "identifierName": "require" }, "name": "require" }, "arguments": [ { "type": "StringLiteral", "start": 35, "end": 40, "loc": { "start": { "line": 3, "column": 20 }, "end": { "line": 3, "column": 25 } }, "extra": { "rawValue": "wkx", "raw": "'wkx'" }, "value": "wkx" } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 43, "end": 71, "loc": { "start": { "line": 4, "column": 0 }, "end": { "line": 4, "column": 28 } }, "declarations": [ { "type": "VariableDeclarator", "start": 49, "end": 70, "loc": { "start": { "line": 4, "column": 6 }, "end": { "line": 4, "column": 27 } }, "id": { "type": "Identifier", "start": 49, "end": 50, "loc": { "start": { "line": 4, "column": 6 }, "end": { "line": 4, "column": 7 }, "identifierName": "_" }, "name": "_" }, "init": { "type": "CallExpression", "start": 53, "end": 70, "loc": { "start": { "line": 4, "column": 10 }, "end": { "line": 4, "column": 27 } }, "callee": { "type": "Identifier", "start": 53, "end": 60, "loc": { "start": { "line": 4, "column": 10 }, "end": { "line": 4, "column": 17 }, "identifierName": "require" }, "name": "require" }, "arguments": [ { "type": "StringLiteral", "start": 61, "end": 69, "loc": { "start": { "line": 4, "column": 18 }, "end": { "line": 4, "column": 26 } }, "extra": { "rawValue": "lodash", "raw": "'lodash'" }, "value": "lodash" } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 72, "end": 114, "loc": { "start": { "line": 5, "column": 0 }, "end": { "line": 5, "column": 42 } }, "declarations": [ { "type": "VariableDeclarator", "start": 78, "end": 113, "loc": { "start": { "line": 5, "column": 6 }, "end": { "line": 5, "column": 41 } }, "id": { "type": "Identifier", "start": 78, "end": 84, "loc": { "start": { "line": 5, "column": 6 }, "end": { "line": 5, "column": 12 }, "identifierName": "moment" }, "name": "moment" }, "init": { "type": "CallExpression", "start": 87, "end": 113, "loc": { "start": { "line": 5, "column": 15 }, "end": { "line": 5, "column": 41 } }, "callee": { "type": "Identifier", "start": 87, "end": 94, "loc": { "start": { "line": 5, "column": 15 }, "end": { "line": 5, "column": 22 }, "identifierName": "require" }, "name": "require" }, "arguments": [ { "type": "StringLiteral", "start": 95, "end": 112, "loc": { "start": { "line": 5, "column": 23 }, "end": { "line": 5, "column": 40 } }, "extra": { "rawValue": "moment-timezone", "raw": "'moment-timezone'" }, "value": "moment-timezone" } ] } } ], "kind": "const" }, { "type": "VariableDeclaration", "start": 115, "end": 164, "loc": { "start": { "line": 6, "column": 0 }, "end": { "line": 6, "column": 49 } }, "declarations": [ { "type": "VariableDeclarator", "start": 121, "end": 163, "loc": { "start": { "line": 6, "column": 6 }, "end": { "line": 6, "column": 48 } }, "id": { "type": "Identifier", "start": 121, "end": 129, "loc": { "start": { "line": 6, "column": 6 }, "end": { "line": 6, "column": 14 }, "identifierName": "inherits" }, "name": "inherits" }, "init": { "type": "CallExpression", "start": 132, "end": 163, "loc": { "start": { "line": 6, "column": 17 }, "end": { "line": 6, "column": 48 } }, "callee": { "type": "Identifier", "start": 132, "end": 139, "loc": { "start": { "line": 6, "column": 17 }, "end": { "line": 6, "column": 24 }, "identifierName": "require" }, "name": "require" }, "arguments": [ { "type": "StringLiteral", "start": 140, "end": 162, "loc": { "start": { "line": 6, "column": 25 }, "end": { "line": 6, "column": 47 } }, "extra": { "rawValue": "../../utils/inherits", "raw": "'../../utils/inherits'" }, "value": "../../utils/inherits" } ] } } ], "kind": "const" }, { "type": "ExpressionStatement", "start": 166, "end": 5114, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 191, "column": 2 } }, "expression": { "type": "AssignmentExpression", "start": 166, "end": 5113, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 191, "column": 1 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 166, "end": 180, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 14 } }, "object": { "type": "Identifier", "start": 166, "end": 172, "loc": { "start": { "line": 8, "column": 0 }, "end": { "line": 8, "column": 6 }, "identifierName": "module" }, "name": "module" }, "property": { "type": "Identifier", "start": 173, "end": 180, "loc": { "start": { "line": 8, "column": 7 }, "end": { "line": 8, "column": 14 }, "identifierName": "exports" }, "name": "exports" }, "computed": false }, "right": { "type": "ArrowFunctionExpression", "start": 183, "end": 5113, "loc": { "start": { "line": 8, "column": 17 }, "end": { "line": 191, "column": 1 } }, "id": null, "generator": false, "expression": false, "async": false, "params": [ { "type": "Identifier", "start": 183, "end": 192, "loc": { "start": { "line": 8, "column": 17 }, "end": { "line": 8, "column": 26 }, "identifierName": "BaseTypes" }, "name": "BaseTypes" } ], "body": { "type": "BlockStatement", "start": 196, "end": 5113, "loc": { "start": { "line": 8, "column": 30 }, "end": { "line": 191, "column": 1 } }, "body": [ { "type": "ExpressionStatement", "start": 200, "end": 302, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 9, "column": 104 } }, "expression": { "type": "AssignmentExpression", "start": 200, "end": 301, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 9, "column": 103 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 200, "end": 241, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 9, "column": 43 } }, "object": { "type": "MemberExpression", "start": 200, "end": 228, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 9, "column": 30 } }, "object": { "type": "MemberExpression", "start": 200, "end": 218, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 9, "column": 20 } }, "object": { "type": "Identifier", "start": 200, "end": 209, "loc": { "start": { "line": 9, "column": 2 }, "end": { "line": 9, "column": 11 }, "identifierName": "BaseTypes" }, "name": "BaseTypes" }, "property": { "type": "Identifier", "start": 210, "end": 218, "loc": { "start": { "line": 9, "column": 12 }, "end": { "line": 9, "column": 20 }, "identifierName": "ABSTRACT" }, "name": "ABSTRACT" }, "computed": false }, "property": { "type": "Identifier", "start": 219, "end": 228, "loc": { "start": { "line": 9, "column": 21 }, "end": { "line": 9, "column": 30 }, "identifierName": "prototype" }, "name": "prototype" }, "computed": false }, "property": { "type": "Identifier", "start": 229, "end": 241, "loc": { "start": { "line": 9, "column": 31 }, "end": { "line": 9, "column": 43 }, "identifierName": "dialectTypes" }, "name": "dialectTypes" }, "computed": false }, "right": { "type": "StringLiteral", "start": 244, "end": 301, "loc": { "start": { "line": 9, "column": 46 }, "end": { "line": 9, "column": 103 } }, "extra": { "rawValue": "https://dev.mysql.com/doc/refman/5.7/en/data-types.html", "raw": "'https://dev.mysql.com/doc/refman/5.7/en/data-types.html'" }, "value": "https://dev.mysql.com/doc/refman/5.7/en/data-types.html" } } }, { "type": "ExpressionStatement", "start": 306, "end": 348, "loc": { "start": { "line": 11, "column": 2 }, "end": { "line": 11, "column": 44 } }, "expression": { "type": "AssignmentExpression", "start": 306, "end": 347, "loc": { "start": { "line": 11, "column": 2 }, "end": { "line": 11, "column": 43 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 306, "end": 332, "loc": { "start": { "line": 11, "column": 2 }, "end": { "line": 11, "column": 28 } }, "object": { "type": "MemberExpression", "start": 306, "end": 326, "loc": { "start": { "line": 11, "column": 2 }, "end": { "line": 11, "column": 22 } }, "object": { "type": "MemberExpression", "start": 306, "end": 320, "loc": { "start": { "line": 11, "column": 2 }, "end": { "line": 11, "column": 16 } }, "object": { "type": "Identifier", "start": 306, "end": 315, "loc": { "start": { "line": 11, "column": 2 }, "end": { "line": 11, "column": 11 }, "identifierName": "BaseTypes" }, "name": "BaseTypes" }, "property": { "type": "Identifier", "start": 316, "end": 320, "loc": { "start": { "line": 11, "column": 12 }, "end": { "line": 11, "column": 16 }, "identifierName": "DATE" }, "name": "DATE" }, "computed": false }, "property": { "type": "Identifier", "start": 321, "end": 326, "loc": { "start": { "line": 11, "column": 17 }, "end": { "line": 11, "column": 22 }, "identifierName": "types" }, "name": "types" }, "computed": false }, "property": { "type": "Identifier", "start": 327, "end": 332, "loc": { "start": { "line": 11, "column": 23 }, "end": { "line": 11, "column": 28 }, "identifierName": "mysql" }, "name": "mysql" }, "computed": false }, "right": { "type": "ArrayExpression", "start": 335, "end": 347, "loc": { "start": { "line": 11, "column": 31 }, "end": { "line": 11, "column": 43 } }, "elements": [ { "type": "StringLiteral", "start": 336, "end": 346, "loc": { "start": { "line": 11, "column": 32 }, "end": { "line": 11, "column": 42 } }, "extra": { "rawValue": "DATETIME", "raw": "'DATETIME'" }, "value": "DATETIME" } ] } } }, { "type": "ExpressionStatement", "start": 351, "end": 397, "loc": { "start": { "line": 12, "column": 2 }, "end": { "line": 12, "column": 48 } }, "expression": { "type": "AssignmentExpression", "start": 351, "end": 396, "loc": { "start": { "line": 12, "column": 2 }, "end": { "line": 12, "column": 47 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 351, "end": 379, "loc": { "start": { "line": 12, "column": 2 }, "end": { "line": 12, "column": 30 } }, "object": { "type": "MemberExpression", "start": 351, "end": 373, "loc": { "start": { "line": 12, "column": 2 }, "end": { "line": 12, "column": 24 } }, "object": { "type": "MemberExpression", "start": 351, "end": 367, "loc": { "start": { "line": 12, "column": 2 }, "end": { "line": 12, "column": 18 } }, "object": { "type": "Identifier", "start": 351, "end": 360, "loc": { "start": { "line": 12, "column": 2 }, "end": { "line": 12, "column": 11 }, "identifierName": "BaseTypes" }, "name": "BaseTypes" }, "property": { "type": "Identifier", "start": 361, "end": 367, "loc": { "start": { "line": 12, "column": 12 }, "end": { "line": 12, "column": 18 }, "identifierName": "STRING" }, "name": "STRING" }, "computed": false }, "property": { "type": "Identifier", "start": 368, "end": 373, "loc": { "start": { "line": 12, "column": 19 }, "end": { "line": 12, "column": 24 }, "identifierName": "types" }, "name": "types" }, "computed": false }, "property": { "type": "Identifier", "start": 374, "end": 379, "loc": { "start": { "line": 12, "column": 25 }, "end": { "line": 12, "column": 30 }, "identifierName": "mysql" }, "name": "mysql" }, "computed": false }, "right": { "type": "ArrayExpression", "start": 382, "end": 396, "loc": { "start": { "line": 12, "column": 33 }, "end": { "line": 12, "column": 47 } }, "elements": [ { "type": "StringLiteral", "start": 383, "end": 395, "loc": { "start": { "line": 12, "column": 34 }, "end": { "line": 12, "column": 46 } }, "extra": { "rawValue": "VAR_STRING", "raw": "'VAR_STRING'" }, "value": "VAR_STRING" } ] } } }, { "type": "ExpressionStatement", "start": 400, "end": 440, "loc": { "start": { "line": 13, "column": 2 }, "end": { "line": 13, "column": 42 } }, "expression": { "type": "AssignmentExpression", "start": 400, "end": 439, "loc": { "start": { "line": 13, "column": 2 }, "end": { "line": 13, "column": 41 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 400, "end": 426, "loc": { "start": { "line": 13, "column": 2 }, "end": { "line": 13, "column": 28 } }, "object": { "type": "MemberExpression", "start": 400, "end": 420, "loc": { "start": { "line": 13, "column": 2 }, "end": { "line": 13, "column": 22 } }, "object": { "type": "MemberExpression", "start": 400, "end": 414, "loc": { "start": { "line": 13, "column": 2 }, "end": { "line": 13, "column": 16 } }, "object": { "type": "Identifier", "start": 400, "end": 409, "loc": { "start": { "line": 13, "column": 2 }, "end": { "line": 13, "column": 11 }, "identifierName": "BaseTypes" }, "name": "BaseTypes" }, "property": { "type": "Identifier", "start": 410, "end": 414, "loc": { "start": { "line": 13, "column": 12 }, "end": { "line": 13, "column": 16 }, "identifierName": "CHAR" }, "name": "CHAR" }, "computed": false }, "property": { "type": "Identifier", "start": 415, "end": 420, "loc": { "start": { "line": 13, "column": 17 }, "end": { "line": 13, "column": 22 }, "identifierName": "types" }, "name": "types" }, "computed": false }, "property": { "type": "Identifier", "start": 421, "end": 426, "loc": { "start": { "line": 13, "column": 23 }, "end": { "line": 13, "column": 28 }, "identifierName": "mysql" }, "name": "mysql" }, "computed": false }, "right": { "type": "ArrayExpression", "start": 429, "end": 439, "loc": { "start": { "line": 13, "column": 31 }, "end": { "line": 13, "column": 41 } }, "elements": [ { "type": "StringLiteral", "start": 430, "end": 438, "loc": { "start": { "line": 13, "column": 32 }, "end": { "line": 13, "column": 40 } }, "extra": { "rawValue": "STRING", "raw": "'STRING'" }, "value": "STRING" } ] } } }, { "type": "ExpressionStatement", "start": 443, "end": 481, "loc": { "start": { "line": 14, "column": 2 }, "end": { "line": 14, "column": 40 } }, "expression": { "type": "AssignmentExpression", "start": 443, "end": 480, "loc": { "start": { "line": 14, "column": 2 }, "end": { "line": 14, "column": 39 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 443, "end": 469, "loc": { "start": { "line": 14, "column": 2 }, "end": { "line": 14, "column": 28 } }, "object": { "type": "MemberExpression", "start": 443, "end": 463, "loc": { "start": { "line": 14, "column": 2 }, "end": { "line": 14, "column": 22 } }, "object": { "type": "MemberExpression", "start": 443, "end": 457, "loc": { "start": { "line": 14, "column": 2 }, "end": { "line": 14, "column": 16 } }, "object": { "type": "Identifier", "start": 443, "end": 452, "loc": { "start": { "line": 14, "column": 2 }, "end": { "line": 14, "column": 11 }, "identifierName": "BaseTypes" }, "name": "BaseTypes" }, "property": { "type": "Identifier", "start": 453, "end": 457, "loc": { "start": { "line": 14, "column": 12 }, "end": { "line": 14, "column": 16 }, "identifierName": "TEXT" }, "name": "TEXT" }, "computed": false }, "property": { "type": "Identifier", "start": 458, "end": 463, "loc": { "start": { "line": 14, "column": 17 }, "end": { "line": 14, "column": 22 }, "identifierName": "types" }, "name": "types" }, "computed": false }, "property": { "type": "Identifier", "start": 464, "end": 469, "loc": { "start": { "line": 14, "column": 23 }, "end": { "line": 14, "column": 28 }, "identifierName": "mysql" }, "name": "mysql" }, "computed": false }, "right": { "type": "ArrayExpression", "start": 472, "end": 480, "loc": { "start": { "line": 14, "column": 31 }, "end": { "line": 14, "column": 39 } }, "elements": [ { "type": "StringLiteral", "start": 473, "end": 479, "loc": { "start": { "line": 14, "column": 32 }, "end": { "line": 14, "column": 38 } }, "extra": { "rawValue": "BLOB", "raw": "'BLOB'" }, "value": "BLOB" } ] } } }, { "type": "ExpressionStatement", "start": 484, "end": 525, "loc": { "start": { "line": 15, "column": 2 }, "end": { "line": 15, "column": 43 } }, "expression": { "type": "AssignmentExpression", "start": 484, "end": 524, "loc": { "start": { "line": 15, "column": 2 }, "end": { "line": 15, "column": 42 } }, "operator": "=", "left": { "type": "MemberExpression", "start": 484, "end": 513, "loc": { "start": { "line": 15, "column": 2 }, "end": { "line": 15, "column": 31 } }, "object": { "type": "MemberExpression", "start": 484, "end": 507, "loc": { "start": { "line": 15, "column": 2 }, "end": { "line": 15, "column": 25 } }, "object": { "type": "MemberExpression", "start": 484, "end": 501, "loc": { "start": { "line": 15, "column": 2 }, "end": { "line": 15, "column": 19 } }, "object": { "type": "Identifier", "start": 484, "end": 493, "loc": { "start": {