sequelize
Version:
Multi dialect ORM for Node.JS/io.js
1,460 lines (1,459 loc) • 3.87 MB
JSON
{
"type": "File",
"start": 0,
"end": 21499,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 703,
"column": 0
}
},
"program": {
"type": "Program",
"start": 0,
"end": 21499,
"loc": {
"start": {
"line": 1,
"column": 0
},
"end": {
"line": 703,
"column": 0
}
},
"sourceType": "module",
"body": [
{
"type": "VariableDeclaration",
"start": 15,
"end": 52,
"loc": {
"start": {
"line": 3,
"column": 0
},
"end": {
"line": 3,
"column": 37
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 21,
"end": 51,
"loc": {
"start": {
"line": 3,
"column": 6
},
"end": {
"line": 3,
"column": 36
}
},
"id": {
"type": "Identifier",
"start": 21,
"end": 26,
"loc": {
"start": {
"line": 3,
"column": 6
},
"end": {
"line": 3,
"column": 11
},
"identifierName": "Utils"
},
"name": "Utils"
},
"init": {
"type": "CallExpression",
"start": 29,
"end": 51,
"loc": {
"start": {
"line": 3,
"column": 14
},
"end": {
"line": 3,
"column": 36
}
},
"callee": {
"type": "Identifier",
"start": 29,
"end": 36,
"loc": {
"start": {
"line": 3,
"column": 14
},
"end": {
"line": 3,
"column": 21
},
"identifierName": "require"
},
"name": "require"
},
"arguments": [
{
"type": "StringLiteral",
"start": 37,
"end": 50,
"loc": {
"start": {
"line": 3,
"column": 22
},
"end": {
"line": 3,
"column": 35
}
},
"extra": {
"rawValue": "../../utils",
"raw": "'../../utils'"
},
"value": "../../utils"
}
]
}
}
],
"kind": "const"
},
{
"type": "VariableDeclaration",
"start": 53,
"end": 99,
"loc": {
"start": {
"line": 4,
"column": 0
},
"end": {
"line": 4,
"column": 46
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 59,
"end": 98,
"loc": {
"start": {
"line": 4,
"column": 6
},
"end": {
"line": 4,
"column": 45
}
},
"id": {
"type": "Identifier",
"start": 59,
"end": 68,
"loc": {
"start": {
"line": 4,
"column": 6
},
"end": {
"line": 4,
"column": 15
},
"identifierName": "SqlString"
},
"name": "SqlString"
},
"init": {
"type": "CallExpression",
"start": 71,
"end": 98,
"loc": {
"start": {
"line": 4,
"column": 18
},
"end": {
"line": 4,
"column": 45
}
},
"callee": {
"type": "Identifier",
"start": 71,
"end": 78,
"loc": {
"start": {
"line": 4,
"column": 18
},
"end": {
"line": 4,
"column": 25
},
"identifierName": "require"
},
"name": "require"
},
"arguments": [
{
"type": "StringLiteral",
"start": 79,
"end": 97,
"loc": {
"start": {
"line": 4,
"column": 26
},
"end": {
"line": 4,
"column": 44
}
},
"extra": {
"rawValue": "../../sql-string",
"raw": "'../../sql-string'"
},
"value": "../../sql-string"
}
]
}
}
],
"kind": "const"
},
{
"type": "VariableDeclaration",
"start": 100,
"end": 130,
"loc": {
"start": {
"line": 5,
"column": 0
},
"end": {
"line": 5,
"column": 30
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 106,
"end": 129,
"loc": {
"start": {
"line": 5,
"column": 6
},
"end": {
"line": 5,
"column": 29
}
},
"id": {
"type": "Identifier",
"start": 106,
"end": 109,
"loc": {
"start": {
"line": 5,
"column": 6
},
"end": {
"line": 5,
"column": 9
},
"identifierName": "Dot"
},
"name": "Dot"
},
"init": {
"type": "CallExpression",
"start": 112,
"end": 129,
"loc": {
"start": {
"line": 5,
"column": 12
},
"end": {
"line": 5,
"column": 29
}
},
"callee": {
"type": "Identifier",
"start": 112,
"end": 119,
"loc": {
"start": {
"line": 5,
"column": 12
},
"end": {
"line": 5,
"column": 19
},
"identifierName": "require"
},
"name": "require"
},
"arguments": [
{
"type": "StringLiteral",
"start": 120,
"end": 128,
"loc": {
"start": {
"line": 5,
"column": 20
},
"end": {
"line": 5,
"column": 28
}
},
"extra": {
"rawValue": "dottie",
"raw": "'dottie'"
},
"value": "dottie"
}
]
}
}
],
"kind": "const"
},
{
"type": "VariableDeclaration",
"start": 131,
"end": 179,
"loc": {
"start": {
"line": 6,
"column": 0
},
"end": {
"line": 6,
"column": 48
}
},
"declarations": [
{
"type": "VariableDeclarator",
"start": 137,
"end": 178,
"loc": {
"start": {
"line": 6,
"column": 6
},
"end": {
"line": 6,
"column": 47
}
},
"id": {
"type": "Identifier",
"start": 137,
"end": 147,
"loc": {
"start": {
"line": 6,
"column": 6
},
"end": {
"line": 6,
"column": 16
},
"identifierName": "QueryTypes"
},
"name": "QueryTypes"
},
"init": {
"type": "CallExpression",
"start": 150,
"end": 178,
"loc": {
"start": {
"line": 6,
"column": 19
},
"end": {
"line": 6,
"column": 47
}
},
"callee": {
"type": "Identifier",
"start": 150,
"end": 157,
"loc": {
"start": {
"line": 6,
"column": 19
},
"end": {
"line": 6,
"column": 26
},
"identifierName": "require"
},
"name": "require"
},
"arguments": [
{
"type": "StringLiteral",
"start": 158,
"end": 177,
"loc": {
"start": {
"line": 6,
"column": 27
},
"end": {
"line": 6,
"column": 46
}
},
"extra": {
"rawValue": "../../query-types",
"raw": "'../../query-types'"
},
"value": "../../query-types"
}
]
}
}
],
"kind": "const"
},
{
"type": "ClassDeclaration",
"start": 181,
"end": 21379,
"loc": {
"start": {
"line": 8,
"column": 0
},
"end": {
"line": 698,
"column": 1
}
},
"id": {
"type": "Identifier",
"start": 187,
"end": 200,
"loc": {
"start": {
"line": 8,
"column": 6
},
"end": {
"line": 8,
"column": 19
},
"identifierName": "AbstractQuery"
},
"name": "AbstractQuery"
},
"superClass": null,
"body": {
"type": "ClassBody",
"start": 201,
"end": 21379,
"loc": {
"start": {
"line": 8,
"column": 20
},
"end": {
"line": 698,
"column": 1
}
},
"body": [
{
"type": "ClassMethod",
"start": 625,
"end": 2580,
"loc": {
"start": {
"line": 24,
"column": 2
},
"end": {
"line": 88,
"column": 3
}
},
"computed": false,
"key": {
"type": "Identifier",
"start": 632,
"end": 652,
"loc": {
"start": {
"line": 24,
"column": 9
},
"end": {
"line": 24,
"column": 29
},
"identifierName": "formatBindParameters"
},
"name": "formatBindParameters"
},
"static": true,
"kind": "method",
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 653,
"end": 656,
"loc": {
"start": {
"line": 24,
"column": 30
},
"end": {
"line": 24,
"column": 33
},
"identifierName": "sql"
},
"name": "sql"
},
{
"type": "Identifier",
"start": 658,
"end": 664,
"loc": {
"start": {
"line": 24,
"column": 35
},
"end": {
"line": 24,
"column": 41
},
"identifierName": "values"
},
"name": "values"
},
{
"type": "Identifier",
"start": 666,
"end": 673,
"loc": {
"start": {
"line": 24,
"column": 43
},
"end": {
"line": 24,
"column": 50
},
"identifierName": "dialect"
},
"name": "dialect"
},
{
"type": "Identifier",
"start": 675,
"end": 690,
"loc": {
"start": {
"line": 24,
"column": 52
},
"end": {
"line": 24,
"column": 67
},
"identifierName": "replacementFunc"
},
"name": "replacementFunc"
},
{
"type": "Identifier",
"start": 692,
"end": 699,
"loc": {
"start": {
"line": 24,
"column": 69
},
"end": {
"line": 24,
"column": 76
},
"identifierName": "options"
},
"name": "options"
}
],
"body": {
"type": "BlockStatement",
"start": 701,
"end": 2580,
"loc": {
"start": {
"line": 24,
"column": 78
},
"end": {
"line": 88,
"column": 3
}
},
"body": [
{
"type": "IfStatement",
"start": 707,
"end": 751,
"loc": {
"start": {
"line": 25,
"column": 4
},
"end": {
"line": 27,
"column": 5
}
},
"test": {
"type": "UnaryExpression",
"start": 711,
"end": 718,
"loc": {
"start": {
"line": 25,
"column": 8
},
"end": {
"line": 25,
"column": 15
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 712,
"end": 718,
"loc": {
"start": {
"line": 25,
"column": 9
},
"end": {
"line": 25,
"column": 15
},
"identifierName": "values"
},
"name": "values"
},
"extra": {
"parenthesizedArgument": false
}
},
"consequent": {
"type": "BlockStatement",
"start": 720,
"end": 751,
"loc": {
"start": {
"line": 25,
"column": 17
},
"end": {
"line": 27,
"column": 5
}
},
"body": [
{
"type": "ReturnStatement",
"start": 728,
"end": 745,
"loc": {
"start": {
"line": 26,
"column": 6
},
"end": {
"line": 26,
"column": 23
}
},
"argument": {
"type": "ArrayExpression",
"start": 735,
"end": 744,
"loc": {
"start": {
"line": 26,
"column": 13
},
"end": {
"line": 26,
"column": 22
}
},
"elements": [
{
"type": "Identifier",
"start": 736,
"end": 739,
"loc": {
"start": {
"line": 26,
"column": 14
},
"end": {
"line": 26,
"column": 17
},
"identifierName": "sql"
},
"name": "sql"
},
{
"type": "ArrayExpression",
"start": 741,
"end": 743,
"loc": {
"start": {
"line": 26,
"column": 19
},
"end": {
"line": 26,
"column": 21
}
},
"elements": []
}
]
}
}
],
"directives": []
},
"alternate": null
},
{
"type": "ExpressionStatement",
"start": 757,
"end": 781,
"loc": {
"start": {
"line": 29,
"column": 4
},
"end": {
"line": 29,
"column": 28
}
},
"expression": {
"type": "AssignmentExpression",
"start": 757,
"end": 780,
"loc": {
"start": {
"line": 29,
"column": 4
},
"end": {
"line": 29,
"column": 27
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 757,
"end": 764,
"loc": {
"start": {
"line": 29,
"column": 4
},
"end": {
"line": 29,
"column": 11
},
"identifierName": "options"
},
"name": "options"
},
"right": {
"type": "LogicalExpression",
"start": 767,
"end": 780,
"loc": {
"start": {
"line": 29,
"column": 14
},
"end": {
"line": 29,
"column": 27
}
},
"left": {
"type": "Identifier",
"start": 767,
"end": 774,
"loc": {
"start": {
"line": 29,
"column": 14
},
"end": {
"line": 29,
"column": 21
},
"identifierName": "options"
},
"name": "options"
},
"operator": "||",
"right": {
"type": "ObjectExpression",
"start": 778,
"end": 780,
"loc": {
"start": {
"line": 29,
"column": 25
},
"end": {
"line": 29,
"column": 27
}
},
"properties": []
}
}
}
},
{
"type": "IfStatement",
"start": 786,
"end": 910,
"loc": {
"start": {
"line": 30,
"column": 4
},
"end": {
"line": 33,
"column": 5
}
},
"test": {
"type": "BinaryExpression",
"start": 790,
"end": 827,
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 45
}
},
"left": {
"type": "UnaryExpression",
"start": 790,
"end": 812,
"loc": {
"start": {
"line": 30,
"column": 8
},
"end": {
"line": 30,
"column": 30
}
},
"operator": "typeof",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 797,
"end": 812,
"loc": {
"start": {
"line": 30,
"column": 15
},
"end": {
"line": 30,
"column": 30
},
"identifierName": "replacementFunc"
},
"name": "replacementFunc"
},
"extra": {
"parenthesizedArgument": false
}
},
"operator": "!==",
"right": {
"type": "StringLiteral",
"start": 817,
"end": 827,
"loc": {
"start": {
"line": 30,
"column": 35
},
"end": {
"line": 30,
"column": 45
}
},
"extra": {
"rawValue": "function",
"raw": "'function'"
},
"value": "function"
}
},
"consequent": {
"type": "BlockStatement",
"start": 829,
"end": 910,
"loc": {
"start": {
"line": 30,
"column": 47
},
"end": {
"line": 33,
"column": 5
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 837,
"end": 869,
"loc": {
"start": {
"line": 31,
"column": 6
},
"end": {
"line": 31,
"column": 38
}
},
"expression": {
"type": "AssignmentExpression",
"start": 837,
"end": 868,
"loc": {
"start": {
"line": 31,
"column": 6
},
"end": {
"line": 31,
"column": 37
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 837,
"end": 844,
"loc": {
"start": {
"line": 31,
"column": 6
},
"end": {
"line": 31,
"column": 13
},
"identifierName": "options"
},
"name": "options"
},
"right": {
"type": "LogicalExpression",
"start": 847,
"end": 868,
"loc": {
"start": {
"line": 31,
"column": 16
},
"end": {
"line": 31,
"column": 37
}
},
"left": {
"type": "Identifier",
"start": 847,
"end": 862,
"loc": {
"start": {
"line": 31,
"column": 16
},
"end": {
"line": 31,
"column": 31
},
"identifierName": "replacementFunc"
},
"name": "replacementFunc"
},
"operator": "||",
"right": {
"type": "ObjectExpression",
"start": 866,
"end": 868,
"loc": {
"start": {
"line": 31,
"column": 35
},
"end": {
"line": 31,
"column": 37
}
},
"properties": []
}
}
}
},
{
"type": "ExpressionStatement",
"start": 876,
"end": 904,
"loc": {
"start": {
"line": 32,
"column": 6
},
"end": {
"line": 32,
"column": 34
}
},
"expression": {
"type": "AssignmentExpression",
"start": 876,
"end": 903,
"loc": {
"start": {
"line": 32,
"column": 6
},
"end": {
"line": 32,
"column": 33
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 876,
"end": 891,
"loc": {
"start": {
"line": 32,
"column": 6
},
"end": {
"line": 32,
"column": 21
},
"identifierName": "replacementFunc"
},
"name": "replacementFunc"
},
"right": {
"type": "Identifier",
"start": 894,
"end": 903,
"loc": {
"start": {
"line": 32,
"column": 24
},
"end": {
"line": 32,
"column": 33
},
"identifierName": "undefined"
},
"name": "undefined"
}
}
}
],
"directives": []
},
"alternate": null
},
{
"type": "IfStatement",
"start": 916,
"end": 1824,
"loc": {
"start": {
"line": 35,
"column": 4
},
"end": {
"line": 61,
"column": 5
}
},
"test": {
"type": "UnaryExpression",
"start": 920,
"end": 936,
"loc": {
"start": {
"line": 35,
"column": 8
},
"end": {
"line": 35,
"column": 24
}
},
"operator": "!",
"prefix": true,
"argument": {
"type": "Identifier",
"start": 921,
"end": 936,
"loc": {
"start": {
"line": 35,
"column": 9
},
"end": {
"line": 35,
"column": 24
},
"identifierName": "replacementFunc"
},
"name": "replacementFunc"
},
"extra": {
"parenthesizedArgument": false
}
},
"consequent": {
"type": "BlockStatement",
"start": 938,
"end": 1456,
"loc": {
"start": {
"line": 35,
"column": 26
},
"end": {
"line": 51,
"column": 5
}
},
"body": [
{
"type": "IfStatement",
"start": 946,
"end": 1450,
"loc": {
"start": {
"line": 36,
"column": 6
},
"end": {
"line": 50,
"column": 7
}
},
"test": {
"type": "MemberExpression",
"start": 950,
"end": 974,
"loc": {
"start": {
"line": 36,
"column": 10
},
"end": {
"line": 36,
"column": 34
}
},
"object": {
"type": "Identifier",
"start": 950,
"end": 957,
"loc": {
"start": {
"line": 36,
"column": 10
},
"end": {
"line": 36,
"column": 17
},
"identifierName": "options"
},
"name": "options"
},
"property": {
"type": "Identifier",
"start": 958,
"end": 974,
"loc": {
"start": {
"line": 36,
"column": 18
},
"end": {
"line": 36,
"column": 34
},
"identifierName": "skipValueReplace"
},
"name": "skipValueReplace"
},
"computed": false
},
"consequent": {
"type": "BlockStatement",
"start": 976,
"end": 1185,
"loc": {
"start": {
"line": 36,
"column": 36
},
"end": {
"line": 43,
"column": 7
}
},
"body": [
{
"type": "ExpressionStatement",
"start": 986,
"end": 1177,
"loc": {
"start": {
"line": 37,
"column": 8
},
"end": {
"line": 42,
"column": 10
}
},
"expression": {
"type": "AssignmentExpression",
"start": 986,
"end": 1176,
"loc": {
"start": {
"line": 37,
"column": 8
},
"end": {
"line": 42,
"column": 9
}
},
"operator": "=",
"left": {
"type": "Identifier",
"start": 986,
"end": 1001,
"loc": {
"start": {
"line": 37,
"column": 8
},
"end": {
"line": 37,
"column": 23
},
"identifierName": "replacementFunc"
},
"name": "replacementFunc"
},
"right": {
"type": "ArrowFunctionExpression",
"start": 1004,
"end": 1176,
"loc": {
"start": {
"line": 37,
"column": 26
},
"end": {
"line": 42,
"column": 9
}
},
"id": null,
"generator": false,
"expression": false,
"async": false,
"params": [
{
"type": "Identifier",
"start": 1005,
"end": 1010,
"loc": {
"start": {
"line": 37,
"column": 27
},
"end": {
"line": 37,
"column": 32
},
"identifierName": "match"
},
"name": "match"
},
{
"type": "Identifier",
"start": 1012,
"end": 1015,
"loc": {
"start": {
"line": 37,
"column": 34
},
"end": {
"line": 37,
"column": 37
},
"identifierName": "key"
},
"name": "key"
},
{
"type": "Identifier",
"start": 1017,
"end": 1023,
"loc": {
"start": {
"line": 37,
"column": 39
},
"end": {
"line": 37,
"column": 45
},
"identifierName": "values"
},
"name": "values"
},
{
"type": "Identifier",
"start": 1025,
"end": 1033,
"loc": {
"start": {
"line": 37,
"column": 47
},
"end": {
"line": 37,
"column": 55
},
"identifierName": "timeZone"
},
"name": "timeZone"
},
{
"type": "Identifier",
"start": 1035,
"end": 1042,
"loc": {
"start": {
"line": 37,
"column": 57
},
"end": {
"line": 37,
"column": 64
},
"identifierName": "dialect"
},
"name": "dialect"
},
{
"type": "Identifier",
"start": 1044,
"end": 1051,
"loc": {
"start": {
"line": 37,
"column": 66
},
"end": {
"line": 37,
"column": 73
},
"identifierName": "options"
},
"name": "options"
}
],
"body": {
"type": "BlockStatement",
"start": 1056,
"end": 1176,
"loc": {
"start": {
"line": 37,
"column": 78
},
"end": {
"line": 42,