sequelize
Version:
Multi dialect ORM for Node.JS/io.js
1,596 lines • 294 kB
JSON
{
"type": "File",
"start": 0,
"end": 1619,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 65,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 1619,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 65,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "VariableDeclaration",
"start": 15,
"end": 43,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 28
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 21,
"end": 42,
"loc": {
"start": {
"line": 3,
"column": 6
},
"end": {
"line": 3,
"column": 27
}
},
"id": {
"type": "Identifier",
"start": 21,
"end": 22,
"loc": {
"start": {
"line": 3,
"column": 6
},
"end": {
"line": 3,
"column": 7
},
"identifierName": "_"
},
"name": "_"
},
"init": {
"type": "CallExpression",
"start": 25,
"end": 42,
"loc": {
"start": {
"line": 3,
"column": 10
},
"end": {
"line": 3,
"column": 27
}
},
"callee": {
"type": "Identifier",
"start": 25,
"end": 32,
"loc": {
"start": {
"line": 3,
"column": 10
},
"end": {
"line": 3,
"column": 17
},
"identifierName": "require"
},
"name": "require"
},
"arguments": [
{
"type": "StringLiteral",
"start": 33,
"end": 41,
"loc": {
"start": {
"line": 3,
"column": 18
},
"end": {
"line": 3,
"column": 26
}
},
"extra": {
"rawValue": "lodash",
"raw": "'lodash'"
},
"value": "lodash"
}
]
}
}
],
"kind": "const"
},
{
"type": "VariableDeclaration",
"start": 44,
"end": 91,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 47
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 50,
"end": 90,
"loc": {
"start": {
"line": 4,
"column": 6
},
"end": {
"line": 4,
"column": 46
}
},
"id": {
"type": "Identifier",
"start": 50,
"end": 65,
"loc": {
"start": {
"line": 4,
"column": 6
},
"end": {
"line": 4,
"column": 21
},
"identifierName": "AbstractDialect"
},
"name": "AbstractDialect"
},
"init": {
"type": "CallExpression",
"start": 68,
"end": 90,
"loc": {
"start": {
"line": 4,
"column": 24
},
"end": {
"line": 4,
"column": 46
}
},
"callee": {
"type": "Identifier",
"start": 68,
"end": 75,
"loc": {
"start": {
"line": 4,
"column": 24
},
"end": {
"line": 4,
"column": 31
},
"identifierName": "require"
},
"name": "require"
},
"arguments": [
{
"type": "StringLiteral",
"start": 76,
"end": 89,
"loc": {
"start": {
"line": 4,
"column": 32
},
"end": {
"line": 4,
"column": 45
}
},
"extra": {
"rawValue": "../abstract",
"raw": "'../abstract'"
},
"value": "../abstract"
}
]
}
}
],
"kind": "const"
},
{
"type": "VariableDeclaration",
"start": 92,
"end": 150,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 58
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 98,
"end": 149,
"loc": {
"start": {
"line": 5,
"column": 6
},
"end": {
"line": 5,
"column": 57
}
},
"id": {
"type": "Identifier",
"start": 98,
"end": 115,
"loc": {
"start": {
"line": 5,
"column": 6
},
"end": {
"line": 5,
"column": 23
},
"identifierName": "ConnectionManager"
},
"name": "ConnectionManager"
},
"init": {
"type": "CallExpression",
"start": 118,
"end": 149,
"loc": {
"start": {
"line": 5,
"column": 26
},
"end": {
"line": 5,
"column": 57
}
},
"callee": {
"type": "Identifier",
"start": 118,
"end": 125,
"loc": {
"start": {
"line": 5,
"column": 26
},
"end": {
"line": 5,
"column": 33
},
"identifierName": "require"
},
"name": "require"
},
"arguments": [
{
"type": "StringLiteral",
"start": 126,
"end": 148,
"loc": {
"start": {
"line": 5,
"column": 34
},
"end": {
"line": 5,
"column": 56
}
},
"extra": {
"rawValue": "./connection-manager",
"raw": "'./connection-manager'"
},
"value": "./connection-manager"
}
]
}
}
],
"kind": "const"
},
{
"type": "VariableDeclaration",
"start": 151,
"end": 184,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 33
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 157,
"end": 183,
"loc": {
"start": {
"line": 6,
"column": 6
},
"end": {
"line": 6,
"column": 32
}
},
"id": {
"type": "Identifier",
"start": 157,
"end": 162,
"loc": {
"start": {
"line": 6,
"column": 6
},
"end": {
"line": 6,
"column": 11
},
"identifierName": "Query"
},
"name": "Query"
},
"init": {
"type": "CallExpression",
"start": 165,
"end": 183,
"loc": {
"start": {
"line": 6,
"column": 14
},
"end": {
"line": 6,
"column": 32
}
},
"callee": {
"type": "Identifier",
"start": 165,
"end": 172,
"loc": {
"start": {
"line": 6,
"column": 14
},
"end": {
"line": 6,
"column": 21
},
"identifierName": "require"
},
"name": "require"
},
"arguments": [
{
"type": "StringLiteral",
"start": 173,
"end": 182,
"loc": {
"start": {
"line": 6,
"column": 22
},
"end": {
"line": 6,
"column": 31
}
},
"extra": {
"rawValue": "./query",
"raw": "'./query'"
},
"value": "./query"
}
]
}
}
],
"kind": "const"
},
{
"type": "VariableDeclaration",
"start": 185,
"end": 237,
"loc": {
"start": {
"line": 7,
"column": 0
},
"end": {
"line": 7,
"column": 52
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 191,
"end": 236,
"loc": {
"start": {
"line": 7,
"column": 6
},
"end": {
"line": 7,
"column": 51
}
},
"id": {
"type": "Identifier",
"start": 191,
"end": 205,
"loc": {
"start": {
"line": 7,
"column": 6
},
"end": {
"line": 7,
"column": 20
},
"identifierName": "QueryGenerator"
},
"name": "QueryGenerator"
},
"init": {
"type": "CallExpression",
"start": 208,
"end": 236,
"loc": {
"start": {
"line": 7,
"column": 23
},
"end": {
"line": 7,
"column": 51
}
},
"callee": {
"type": "Identifier",
"start": 208,
"end": 215,
"loc": {
"start": {
"line": 7,
"column": 23
},
"end": {
"line": 7,
"column": 30
},
"identifierName": "require"
},
"name": "require"
},
"arguments": [
{
"type": "StringLiteral",
"start": 216,
"end": 235,
"loc": {
"start": {
"line": 7,
"column": 31
},
"end": {
"line": 7,
"column": 50
}
},
"extra": {
"rawValue": "./query-generator",
"raw": "'./query-generator'"
},
"value": "./query-generator"
}
]
}
}
],
"kind": "const"
},
{
"type": "VariableDeclaration",
"start": 238,
"end": 290,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 8,
"column": 52
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 244,
"end": 289,
"loc": {
"start": {
"line": 8,
"column": 6
},
"end": {
"line": 8,
"column": 51
}
},
"id": {
"type": "Identifier",
"start": 244,
"end": 253,
"loc": {
"start": {
"line": 8,
"column": 6
},
"end": {
"line": 8,
"column": 15
},
"identifierName": "DataTypes"
},
"name": "DataTypes"
},
"init": {
"type": "MemberExpression",
"start": 256,
"end": 289,
"loc": {
"start": {
"line": 8,
"column": 18
},
"end": {
"line": 8,
"column": 51
}
},
"object": {
"type": "CallExpression",
"start": 256,
"end": 283,
"loc": {
"start": {
"line": 8,
"column": 18
},
"end": {
"line": 8,
"column": 45
}
},
"callee": {
"type": "Identifier",
"start": 256,
"end": 263,
"loc": {
"start": {
"line": 8,
"column": 18
},
"end": {
"line": 8,
"column": 25
},
"identifierName": "require"
},
"name": "require"
},
"arguments": [
{
"type": "StringLiteral",
"start": 264,
"end": 282,
"loc": {
"start": {
"line": 8,
"column": 26
},
"end": {
"line": 8,
"column": 44
}
},
"extra": {
"rawValue": "../../data-types",
"raw": "'../../data-types'"
},
"value": "../../data-types"
}
]
},
"property": {
"type": "Identifier",
"start": 284,
"end": 289,
"loc": {
"start": {
"line": 8,
"column": 46
},
"end": {
"line": 8,
"column": 51
},
"identifierName": "mssql"
},
"name": "mssql"
},
"computed": false
}
}
],
"kind": "const"
},
{
"type": "ClassDeclaration",
"start": 292,
"end": 620,
"loc": {
"start": {
"line": 10,
"column": 0
},
"end": {
"line": 21,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 298,
"end": 310,
"loc": {
"start": {
"line": 10,
"column": 6
},
"end": {
"line": 10,
"column": 18
},
"identifierName": "MssqlDialect"
},
"name": "MssqlDialect"
},
"superClass": {
"type": "Identifier",
"start": 319,
"end": 334,
"loc": {
"start": {
"line": 10,
"column": 27
},
"end": {
"line": 10,
"column": 42
},
"identifierName": "AbstractDialect"
},
"name": "AbstractDialect"
},
"body": {
"type": "ClassBody",
"start": 335,
"end": 620,
"loc": {
"start": {
"line": 10,
"column": 43
},
"end": {
"line": 21,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 339,
"end": 618,
"loc": {
"start": {
"line": 11,
"column": 2
},
"end": {
"line": 20,
"column": 3
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 339,
"end": 350,
"loc": {
"start": {
"line": 11,
"column": 2
},
"end": {
"line": 11,
"column": 13
},
"identifierName": "constructor"
},
"name": "constructor"
},
"static": false,
"kind": "constructor",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 351,
"end": 360,
"loc": {
"start": {
"line": 11,
"column": 14
},
"end": {
"line": 11,
"column": 23
},
"identifierName": "sequelize"
},
"name": "sequelize"
}
],
"body": {
"type": "BlockStatement",
"start": 362,
"end": 618,
"loc": {
"start": {
"line": 11,
"column": 25
},
"end": {
"line": 20,
"column": 3
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 368,
"end": 376,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 12
}
},
"expression": {
"type": "CallExpression",
"start": 368,
"end": 375,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 11
}
},
"callee": {
"type": "Super",
"start": 368,
"end": 373,
"loc": {
"start": {
"line": 12,
"column": 4
},
"end": {
"line": 12,
"column": 9
}
}
},
"arguments": []
}
},
{
"type": "ExpressionStatement",
"start": 381,
"end": 408,
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 13,
"column": 31
}
},
"expression": {
"type": "AssignmentExpression",
"start": 381,
"end": 407,
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 13,
"column": 30
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 381,
"end": 395,
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 13,
"column": 18
}
},
"object": {
"type": "ThisExpression",
"start": 381,
"end": 385,
"loc": {
"start": {
"line": 13,
"column": 4
},
"end": {
"line": 13,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 386,
"end": 395,
"loc": {
"start": {
"line": 13,
"column": 9
},
"end": {
"line": 13,
"column": 18
},
"identifierName": "sequelize"
},
"name": "sequelize"
},
"computed": false
},
"right": {
"type": "Identifier",
"start": 398,
"end": 407,
"loc": {
"start": {
"line": 13,
"column": 21
},
"end": {
"line": 13,
"column": 30
},
"identifierName": "sequelize"
},
"name": "sequelize"
}
}
},
{
"type": "ExpressionStatement",
"start": 413,
"end": 477,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 68
}
},
"expression": {
"type": "AssignmentExpression",
"start": 413,
"end": 476,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 67
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 413,
"end": 435,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 26
}
},
"object": {
"type": "ThisExpression",
"start": 413,
"end": 417,
"loc": {
"start": {
"line": 14,
"column": 4
},
"end": {
"line": 14,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 418,
"end": 435,
"loc": {
"start": {
"line": 14,
"column": 9
},
"end": {
"line": 14,
"column": 26
},
"identifierName": "connectionManager"
},
"name": "connectionManager"
},
"computed": false
},
"right": {
"type": "NewExpression",
"start": 438,
"end": 476,
"loc": {
"start": {
"line": 14,
"column": 29
},
"end": {
"line": 14,
"column": 67
}
},
"callee": {
"type": "Identifier",
"start": 442,
"end": 459,
"loc": {
"start": {
"line": 14,
"column": 33
},
"end": {
"line": 14,
"column": 50
},
"identifierName": "ConnectionManager"
},
"name": "ConnectionManager"
},
"arguments": [
{
"type": "ThisExpression",
"start": 460,
"end": 464,
"loc": {
"start": {
"line": 14,
"column": 51
},
"end": {
"line": 14,
"column": 55
}
}
},
{
"type": "Identifier",
"start": 466,
"end": 475,
"loc": {
"start": {
"line": 14,
"column": 57
},
"end": {
"line": 14,
"column": 66
},
"identifierName": "sequelize"
},
"name": "sequelize"
}
]
}
}
},
{
"type": "ExpressionStatement",
"start": 482,
"end": 614,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 19,
"column": 7
}
},
"expression": {
"type": "AssignmentExpression",
"start": 482,
"end": 613,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 19,
"column": 6
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 482,
"end": 501,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 23
}
},
"object": {
"type": "ThisExpression",
"start": 482,
"end": 486,
"loc": {
"start": {
"line": 15,
"column": 4
},
"end": {
"line": 15,
"column": 8
}
}
},
"property": {
"type": "Identifier",
"start": 487,
"end": 501,
"loc": {
"start": {
"line": 15,
"column": 9
},
"end": {
"line": 15,
"column": 23
},
"identifierName": "QueryGenerator"
},
"name": "QueryGenerator"
},
"computed": false
},
"right": {
"type": "CallExpression",
"start": 504,
"end": 613,
"loc": {
"start": {
"line": 15,
"column": 26
},
"end": {
"line": 19,
"column": 6
}
},
"callee": {
"type": "MemberExpression",
"start": 504,
"end": 512,
"loc": {
"start": {
"line": 15,
"column": 26
},
"end": {
"line": 15,
"column": 34
}
},
"object": {
"type": "Identifier",
"start": 504,
"end": 505,
"loc": {
"start": {
"line": 15,
"column": 26
},
"end": {
"line": 15,
"column": 27
},
"identifierName": "_"
},
"name": "_"
},
"property": {
"type": "Identifier",
"start": 506,
"end": 512,
"loc": {
"start": {
"line": 15,
"column": 28
},
"end": {
"line": 15,
"column": 34
},
"identifierName": "extend"
},
"name": "extend"
},
"computed": false
},
"arguments": [
{
"type": "ObjectExpression",
"start": 513,
"end": 515,
"loc": {
"start": {
"line": 15,
"column": 35
},
"end": {
"line": 15,
"column": 37
}
},
"properties": []
},
{
"type": "Identifier",
"start": 517,
"end": 531,
"loc": {
"start": {
"line": 15,
"column": 39
},
"end": {
"line": 15,
"column": 53
},
"identifierName": "QueryGenerator"
},
"name": "QueryGenerator"
},
{
"type": "ObjectExpression",
"start": 533,
"end": 612,
"loc": {
"start": {
"line": 15,
"column": 55
},
"end": {
"line": 19,
"column": 5
}
},
"properties": [
{
"type": "ObjectProperty",
"start": 541,
"end": 567,
"loc": {
"start": {
"line": 16,
"column": 6
},
"end": {
"line": 16,
"column": 32
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 541,
"end": 548,
"loc": {
"start": {
"line": 16,
"column": 6
},
"end": {
"line": 16,
"column": 13
},
"identifierName": "options"
},
"name": "options"
},
"value": {
"type": "MemberExpression",
"start": 550,
"end": 567,
"loc": {
"start": {
"line": 16,
"column": 15
},
"end": {
"line": 16,
"column": 32
}
},
"object": {
"type": "Identifier",
"start": 550,
"end": 559,
"loc": {
"start": {
"line": 16,
"column": 15
},
"end": {
"line": 16,
"column": 24
},
"identifierName": "sequelize"
},
"name": "sequelize"
},
"property": {
"type": "Identifier",
"start": 560,
"end": 567,
"loc": {
"start": {
"line": 16,
"column": 25
},
"end": {
"line": 16,
"column": 32
},
"identifierName": "options"
},
"name": "options"
},
"computed": false
}
},
{
"type": "ObjectProperty",
"start": 575,
"end": 589,
"loc": {
"start": {
"line": 17,
"column": 6
},
"end": {
"line": 17,
"column": 20
}
},
"method": false,
"shorthand": false,
"computed": false,
"key": {
"type": "Identifier",
"start": 575,
"end": 583,
"loc": {
"start": {
"line": 17,
"column": 6
},
"end": {
"line": 17,
"column": 14
},
"identifierName": "_dialect"
},
"name": "_dialect"
},
"value": {
"type": "ThisExpression",
"start": 585,
"end": 589,
"loc": {
"start": {
"line": 17,
"column": 16
},
"end": {
"line": 17,
"column": 20
}
}
}
},
{
"type": "ObjectProperty",
"start": 597,
"end": 606,
"loc": {
"start": {
"line": 18,
"column": 6
},
"end": {
"line": 18,
"column": 15
}
},
"method": false,
"shorthand": true,
"computed": false,
"key": {
"type": "Identifier",
"start": 597,
"end": 606,
"loc": {
"start": {
"line": 18,
"column": 6
},
"end": {
"line": 18,
"column": 15
},
"identifierName": "sequelize"
},
"name": "sequelize"
},
"value": {
"type": "Identifier",
"start": 597,
"end": 606,
"loc": {
"start": {
"line": 18,
"column": 6
},
"end": {
"line": 18,
"column": 15
},
"identifierName": "sequelize"
},
"name": "sequelize"
},
"extra": {
"shorthand": true
}
}
]
}
]
}
}
}
],
"directives": []
}
}
]
}
},
{
"type": "ExpressionStatement",
"start": 622,
"end": 1246,
"loc": {
"start": {
"line": 23,
"column": 0
},
"end": {
"line": 54,
"column": 3
}
},
"expression": {
"type": "AssignmentExpression",
"start": 622,
"end": 1245,
"loc": {
"start": {
"line": 23,
"column": 0
},
"end": {
"line": 54,
"column": 2
}
},
"operator": "=",
"left": {
"type": "MemberExpression",
"start": 622,
"end": 653,
"loc": {
"start": {
"line": 23,
"column": 0
},
"end": {
"line": 23,
"column": 31
}
},
"object": {
"type": "MemberExpression",
"start": 622,
"end": 644,
"loc": {
"start": {
"line": 23,
"column": 0
},
"end": {
"line": 23,
"column": 22
}
},
"object": {
"type": "Identifier",
"start": 622,
"end": 634,
"loc": {
"start": {
"line": 23,
"column": 0
},
"end": {
"line": 23,
"column": 12
},
"identifierName": "MssqlDialect"
},
"name": "MssqlDialect"
},
"property": {
"type": "Identifier",
"start": 635,
"end": 644,
"loc": {
"start": {
"line": 23,
"column": 13
},
"end": {
"line": 23,
"column": 22
},
"identifierName": "prototype"
},
"name": "prototype"
},
"computed": false
},
"p