{ "version": 3, "sources": ["../../../src/dialects/mssql/query-generator.js"], "sourcesContent": ["'use strict';\n\nconst _ = require('lodash');\nconst Utils = require('../../utils');\nconst DataTypes = require('../../data-types');\nconst TableHints = require('../../table-hints');\nconst AbstractQueryGenerator = require('../abstract/query-generator');\nconst randomBytes = require('crypto').randomBytes;\nconst semver = require('semver');\nconst Op = require('../../operators');\n\n/* istanbul ignore next */\nconst throwMethodUndefined = function(methodName) {\n throw new Error(`The method \"${methodName}\" is not defined! Please add it to your sql dialect.`);\n};\n\nclass MSSQLQueryGenerator extends AbstractQueryGenerator {\n createDatabaseQuery(databaseName, options) {\n options = { collate: null, ...options };\n\n const collation = options.collate ? `COLLATE ${this.escape(options.collate)}` : '';\n\n return [\n 'IF NOT EXISTS (SELECT * FROM sys.databases WHERE name =', wrapSingleQuote(databaseName), ')',\n 'BEGIN',\n 'CREATE DATABASE', this.quoteIdentifier(databaseName),\n `${collation};`,\n 'END;'\n ].join(' ');\n }\n\n dropDatabaseQuery(databaseName) {\n return [\n 'IF EXISTS (SELECT * FROM sys.databases WHERE name =', wrapSingleQuote(databaseName), ')',\n 'BEGIN',\n 'DROP DATABASE', this.quoteIdentifier(databaseName), ';',\n 'END;'\n ].join(' ');\n }\n\n createSchema(schema) {\n return [\n 'IF NOT EXISTS (SELECT schema_name',\n 'FROM information_schema.schemata',\n 'WHERE schema_name =', wrapSingleQuote(schema), ')',\n 'BEGIN',\n \"EXEC sp_executesql N'CREATE SCHEMA\",\n this.quoteIdentifier(schema),\n \";'\",\n 'END;'\n ].join(' ');\n }\n\n dropSchema(schema) {\n // Mimics Postgres CASCADE, will drop objects belonging to the schema\n const quotedSchema = wrapSingleQuote(schema);\n return [\n 'IF EXISTS (SELECT schema_name',\n 'FROM information_schema.schemata',\n 'WHERE schema_name =', quotedSchema, ')',\n 'BEGIN',\n 'DECLARE @id INT, @ms_sql NVARCHAR(2000);',\n 'DECLARE @cascade TABLE (',\n 'id INT NOT NULL IDENTITY PRIMARY KEY,',\n 'ms_sql NVARCHAR(2000) NOT NULL );',\n 'INSERT INTO @cascade ( ms_sql )',\n \"SELECT CASE WHEN o.type IN ('F','PK')\",\n \"THEN N'ALTER TABLE ['+ s.name + N'].[' + p.name + N'] DROP CONSTRAINT [' + o.name + N']'\",\n \"ELSE N'DROP TABLE ['+ s.name + N'].[' + o.name + N']' END\",\n 'FROM sys.objects o',\n 'JOIN sys.schemas s on o.schema_id = s.schema_id',\n 'LEFT OUTER JOIN sys.objects p on o.parent_object_id = p.object_id',\n \"WHERE o.type IN ('F', 'PK', 'U') AND s.name = \", quotedSchema,\n 'ORDER BY o.type ASC;',\n 'SELECT TOP 1 @id = id, @ms_sql = ms_sql FROM @cascade ORDER BY id;',\n 'WHILE @id IS NOT NULL',\n 'BEGIN',\n 'BEGIN TRY EXEC sp_executesql @ms_sql; END TRY',\n 'BEGIN CATCH BREAK; THROW; END CATCH;',\n 'DELETE FROM @cascade WHERE id = @id;',\n 'SELECT @id = NULL, @ms_sql = NULL;',\n 'SELECT TOP 1 @id = id, @ms_sql = ms_sql FROM @cascade ORDER BY id;',\n 'END',\n \"EXEC sp_executesql N'DROP SCHEMA\", this.quoteIdentifier(schema), \";'\",\n 'END;'\n ].join(' ');\n }\n\n showSchemasQuery() {\n return [\n 'SELECT \"name\" as \"schema_name\" FROM sys.schemas as s',\n 'WHERE \"s\".\"name\" NOT IN (',\n \"'INFORMATION_SCHEMA', 'dbo', 'guest', 'sys', 'archive'\",\n ')', 'AND', '\"s\".\"name\" NOT LIKE', \"'db_%'\"\n ].join(' ');\n }\n\n versionQuery() {\n // Uses string manipulation to convert the MS Maj.Min.Patch.Build to semver Maj.Min.Patch\n return [\n 'DECLARE @ms_ver NVARCHAR(20);',\n \"SET @ms_ver = REVERSE(CONVERT(NVARCHAR(20), SERVERPROPERTY('ProductVersion')));\",\n \"SELECT REVERSE(SUBSTRING(@ms_ver, CHARINDEX('.', @ms_ver)+1, 20)) AS 'version'\"\n ].join(' ');\n }\n\n createTableQuery(tableName, attributes, options) {\n const primaryKeys = [],\n foreignKeys = {},\n attributesClauseParts = [];\n\n let commentStr = '';\n\n for (const attr in attributes) {\n if (Object.prototype.hasOwnProperty.call(attributes, attr)) {\n let dataType = attributes[attr];\n let match;\n\n if (dataType.includes('COMMENT ')) {\n const commentMatch = dataType.match(/^(.+) (COMMENT.*)$/);\n const commentText = commentMatch[2].replace('COMMENT', '').trim();\n commentStr += this.commentTemplate(commentText, tableName, attr);\n // remove comment related substring from dataType\n dataType = commentMatch[1];\n }\n\n if (dataType.includes('PRIMARY KEY')) {\n primaryKeys.push(attr);\n\n if (dataType.includes('REFERENCES')) {\n // MSSQL doesn't support inline REFERENCES declarations: move to the end\n match = dataType.match(/^(.+) (REFERENCES.*)$/);\n attributesClauseParts.push(`${this.quoteIdentifier(attr)} ${match[1].replace('PRIMARY KEY', '')}`);\n foreignKeys[attr] = match[2];\n } else {\n attributesClauseParts.push(`${this.quoteIdentifier(attr)} ${dataType.replace('PRIMARY KEY', '')}`);\n }\n } else if (dataType.includes('REFERENCES')) {\n // MSSQL doesn't support inline REFERENCES declarations: move to the end\n match = dataType.match(/^(.+) (REFERENCES.*)$/);\n attributesClauseParts.push(`${this.quoteIdentifier(attr)} ${match[1]}`);\n foreignKeys[attr] = match[2];\n } else {\n attributesClauseParts.push(`${this.quoteIdentifier(attr)} ${dataType}`);\n }\n }\n }\n\n const pkString = primaryKeys.map(pk => this.quoteIdentifier(pk)).join(', ');\n\n if (options.uniqueKeys) {\n _.each(options.uniqueKeys, (columns, indexName) => {\n if (columns.customIndex) {\n if (typeof indexName !== 'string') {\n indexName = `uniq_${tableName}_${columns.fields.join('_')}`;\n }\n attributesClauseParts.push(`CONSTRAINT ${\n this.quoteIdentifier(indexName)\n } UNIQUE (${\n columns.fields.map(field => this.quoteIdentifier(field)).join(', ')\n })`);\n }\n });\n }\n\n if (pkString.length > 0) {\n attributesClauseParts.push(`PRIMARY KEY (${pkString})`);\n }\n\n for (const fkey in foreignKeys) {\n if (Object.prototype.hasOwnProperty.call(foreignKeys, fkey)) {\n attributesClauseParts.push(`FOREIGN KEY (${this.quoteIdentifier(fkey)}) ${foreignKeys[fkey]}`);\n }\n }\n\n const quotedTableName = this.quoteTable(tableName);\n\n return Utils.joinSQLFragments([\n `IF OBJECT_ID('${quotedTableName}', 'U') IS NULL`,\n `CREATE TABLE ${quotedTableName} (${attributesClauseParts.join(', ')})`,\n ';',\n commentStr\n ]);\n }\n\n describeTableQuery(tableName, schema) {\n let sql = [\n 'SELECT',\n \"c.COLUMN_NAME AS 'Name',\",\n \"c.DATA_TYPE AS 'Type',\",\n \"c.CHARACTER_MAXIMUM_LENGTH AS 'Length',\",\n \"c.IS_NULLABLE as 'IsNull',\",\n \"COLUMN_DEFAULT AS 'Default',\",\n \"pk.CONSTRAINT_TYPE AS 'Constraint',\",\n \"COLUMNPROPERTY(OBJECT_ID(c.TABLE_SCHEMA+'.'+c.TABLE_NAME), c.COLUMN_NAME, 'IsIdentity') as 'IsIdentity',\",\n \"CAST(prop.value AS NVARCHAR) AS 'Comment'\",\n 'FROM',\n 'INFORMATION_SCHEMA.TABLES t',\n 'INNER JOIN',\n 'INFORMATION_SCHEMA.COLUMNS c ON t.TABLE_NAME = c.TABLE_NAME AND t.TABLE_SCHEMA = c.TABLE_SCHEMA',\n 'LEFT JOIN (SELECT tc.table_schema, tc.table_name, ',\n 'cu.column_name, tc.CONSTRAINT_TYPE ',\n 'FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS tc ',\n 'JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE cu ',\n 'ON tc.table_schema=cu.table_schema and tc.table_name=cu.table_name ',\n 'and tc.constraint_name=cu.constraint_name ',\n 'and tc.CONSTRAINT_TYPE=\\'PRIMARY KEY\\') pk ',\n 'ON pk.table_schema=c.table_schema ',\n 'AND pk.table_name=c.table_name ',\n 'AND pk.column_name=c.column_name ',\n 'INNER JOIN sys.columns AS sc',\n \"ON sc.object_id = object_id(t.table_schema + '.' + t.table_name) AND sc.name = c.column_name\",\n 'LEFT JOIN sys.extended_properties prop ON prop.major_id = sc.object_id',\n 'AND prop.minor_id = sc.column_id',\n \"AND prop.name = 'MS_Description'\",\n 'WHERE t.TABLE_NAME =', wrapSingleQuote(tableName)\n ].join(' ');\n\n if (schema) {\n sql += `AND t.TABLE_SCHEMA =${wrapSingleQuote(schema)}`;\n }\n\n return sql;\n }\n\n renameTableQuery(before, after) {\n return `EXEC sp_rename ${this.quoteTable(before)}, ${this.quoteTable(after)};`;\n }\n\n showTablesQuery() {\n return \"SELECT TABLE_NAME, TABLE_SCHEMA FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE';\";\n }\n\n tableExistsQuery(table) {\n const tableName = table.tableName || table;\n const schemaName = table.schema || 'dbo';\n\n return `SELECT TABLE_NAME, TABLE_SCHEMA FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_NAME = ${this.escape(tableName)} AND TABLE_SCHEMA = ${this.escape(schemaName)}`;\n }\n\n dropTableQuery(tableName) {\n const quoteTbl = this.quoteTable(tableName);\n return Utils.joinSQLFragments([\n `IF OBJECT_ID('${quoteTbl}', 'U') IS NOT NULL`,\n 'DROP TABLE',\n quoteTbl,\n ';'\n ]);\n }\n\n addColumnQuery(table, key, dataType) {\n // FIXME: attributeToSQL SHOULD be using attributes in addColumnQuery\n // but instead we need to pass the key along as the field here\n dataType.field = key;\n let commentStr = '';\n\n if (dataType.comment && _.isString(dataType.comment)) {\n commentStr = this.commentTemplate(dataType.comment, table, key);\n // attributeToSQL will try to include `COMMENT 'Comment Text'` when it returns if the comment key\n // is present. This is needed for createTable statement where that part is extracted with regex.\n // Here we can intercept the object and remove comment property since we have the original object.\n delete dataType['comment'];\n }\n\n return Utils.joinSQLFragments([\n 'ALTER TABLE',\n this.quoteTable(table),\n 'ADD',\n this.quoteIdentifier(key),\n this.attributeToSQL(dataType, { context: 'addColumn' }),\n ';',\n commentStr\n ]);\n }\n\n commentTemplate(comment, table, column) {\n return ' EXEC sp_addextendedproperty ' +\n `@name = N'MS_Description', @value = ${this.escape(comment)}, ` +\n '@level0type = N\\'Schema\\', @level0name = \\'dbo\\', ' +\n `@level1type = N'Table', @level1name = ${this.quoteIdentifier(table)}, ` +\n `@level2type = N'Column', @level2name = ${this.quoteIdentifier(column)};`;\n }\n\n removeColumnQuery(tableName, attributeName) {\n return Utils.joinSQLFragments([\n 'ALTER TABLE',\n this.quoteTable(tableName),\n 'DROP COLUMN',\n this.quoteIdentifier(attributeName),\n ';'\n ]);\n }\n\n changeColumnQuery(tableName, attributes) {\n const attrString = [],\n constraintString = [];\n let commentString = '';\n\n for (const attributeName in attributes) {\n const quotedAttrName = this.quoteIdentifier(attributeName);\n let definition = attributes[attributeName];\n if (definition.includes('COMMENT ')) {\n const commentMatch = definition.match(/^(.+) (COMMENT.*)$/);\n const commentText = commentMatch[2].replace('COMMENT', '').trim();\n commentString += this.commentTemplate(commentText, tableName, attributeName);\n // remove comment related substring from dataType\n definition = commentMatch[1];\n }\n if (definition.includes('REFERENCES')) {\n constraintString.push(`FOREIGN KEY (${quotedAttrName}) ${definition.replace(/.+?(?=REFERENCES)/, '')}`);\n } else {\n attrString.push(`${quotedAttrName} ${definition}`);\n }\n }\n\n return Utils.joinSQLFragments([\n 'ALTER TABLE',\n this.quoteTable(tableName),\n attrString.length && `ALTER COLUMN ${attrString.join(', ')}`,\n constraintString.length && `ADD ${constraintString.join(', ')}`,\n ';',\n commentString\n ]);\n }\n\n renameColumnQuery(tableName, attrBefore, attributes) {\n const newName = Object.keys(attributes)[0];\n return Utils.joinSQLFragments([\n 'EXEC sp_rename',\n `'${this.quoteTable(tableName)}.${attrBefore}',`,\n `'${newName}',`,\n \"'COLUMN'\",\n ';'\n ]);\n }\n\n bulkInsertQuery(tableName, attrValueHashes, options, attributes) {\n const quotedTable = this.quoteTable(tableName);\n options = options || {};\n attributes = attributes || {};\n\n const tuples = [];\n const allAttributes = [];\n const allQueries = [];\n\n let needIdentityInsertWrapper = false,\n outputFragment = '';\n\n if (options.returning) {\n const returnValues = this.generateReturnValues(attributes, options);\n\n outputFragment = returnValues.outputFragment;\n }\n\n const emptyQuery = `INSERT INTO ${quotedTable}${outputFragment} DEFAULT VALUES`;\n\n attrValueHashes.forEach(attrValueHash => {\n // special case for empty objects with primary keys\n const fields = Object.keys(attrValueHash);\n const firstAttr = attributes[fields[0]];\n if (fields.length === 1 && firstAttr && firstAttr.autoIncrement && attrValueHash[fields[0]] === null) {\n allQueries.push(emptyQuery);\n return;\n }\n\n // normal case\n _.forOwn(attrValueHash, (value, key) => {\n if (value !== null && attributes[key] && attributes[key].autoIncrement) {\n needIdentityInsertWrapper = true;\n }\n\n if (!allAttributes.includes(key)) {\n if (value === null && attributes[key] && attributes[key].autoIncrement)\n return;\n\n allAttributes.push(key);\n }\n });\n });\n\n if (allAttributes.length > 0) {\n attrValueHashes.forEach(attrValueHash => {\n tuples.push(`(${\n allAttributes.map(key =>\n this.escape(attrValueHash[key])).join(',')\n })`);\n });\n\n const quotedAttributes = allAttributes.map(attr => this.quoteIdentifier(attr)).join(',');\n allQueries.push(tupleStr => `INSERT INTO ${quotedTable} (${quotedAttributes})${outputFragment} VALUES ${tupleStr};`);\n }\n const commands = [];\n let offset = 0;\n const batch = Math.floor(250 / (allAttributes.length + 1)) + 1;\n while (offset < Math.max(tuples.length, 1)) {\n const tupleStr = tuples.slice(offset, Math.min(tuples.length, offset + batch));\n let generatedQuery = allQueries.map(v => typeof v === 'string' ? v : v(tupleStr)).join(';');\n if (needIdentityInsertWrapper) {\n generatedQuery = `SET IDENTITY_INSERT ${quotedTable} ON; ${generatedQuery}; SET IDENTITY_INSERT ${quotedTable} OFF;`;\n }\n commands.push(generatedQuery);\n offset += batch;\n }\n return commands.join(';');\n }\n\n updateQuery(tableName, attrValueHash, where, options, attributes) {\n const sql = super.updateQuery(tableName, attrValueHash, where, options, attributes);\n if (options.limit) {\n const updateArgs = `UPDATE TOP(${this.escape(options.limit)})`;\n sql.query = sql.query.replace('UPDATE', updateArgs);\n }\n return sql;\n }\n\n upsertQuery(tableName, insertValues, updateValues, where, model) {\n const targetTableAlias = this.quoteTable(`${tableName}_target`);\n const sourceTableAlias = this.quoteTable(`${tableName}_source`);\n const primaryKeysAttrs = [];\n const identityAttrs = [];\n const uniqueAttrs = [];\n const tableNameQuoted = this.quoteTable(tableName);\n let needIdentityInsertWrapper = false;\n\n //Obtain primaryKeys, uniquekeys and identity attrs from rawAttributes as model is not passed\n for (const key in model.rawAttributes) {\n if (model.rawAttributes[key].primaryKey) {\n primaryKeysAttrs.push(model.rawAttributes[key].field || key);\n }\n if (model.rawAttributes[key].unique) {\n uniqueAttrs.push(model.rawAttributes[key].field || key);\n }\n if (model.rawAttributes[key].autoIncrement) {\n identityAttrs.push(model.rawAttributes[key].field || key);\n }\n }\n\n //Add unique indexes defined by indexes option to uniqueAttrs\n for (const index of model._indexes) {\n if (index.unique && index.fields) {\n for (const field of index.fields) {\n const fieldName = typeof field === 'string' ? field : field.name || field.attribute;\n if (!uniqueAttrs.includes(fieldName) && model.rawAttributes[fieldName]) {\n uniqueAttrs.push(fieldName);\n }\n }\n }\n }\n\n const updateKeys = Object.keys(updateValues);\n const insertKeys = Object.keys(insertValues);\n const insertKeysQuoted = insertKeys.map(key => this.quoteIdentifier(key)).join(', ');\n const insertValuesEscaped = insertKeys.map(key => this.escape(insertValues[key])).join(', ');\n const sourceTableQuery = `VALUES(${insertValuesEscaped})`; //Virtual Table\n let joinCondition;\n\n //IDENTITY_INSERT Condition\n identityAttrs.forEach(key => {\n if (insertValues[key] && insertValues[key] !== null) {\n needIdentityInsertWrapper = true;\n /*\n * IDENTITY_INSERT Column Cannot be updated, only inserted\n * http://stackoverflow.com/a/30176254/2254360\n */\n }\n });\n\n //Filter NULL Clauses\n const clauses = where[Op.or].filter(clause => {\n let valid = true;\n /*\n * Exclude NULL Composite PK/UK. Partial Composite clauses should also be excluded as it doesn't guarantee a single row\n */\n for (const key in clause) {\n if (typeof clause[key] === 'undefined' || clause[key] == null) {\n valid = false;\n break;\n }\n }\n return valid;\n });\n\n /*\n * Generate ON condition using PK(s).\n * If not, generate using UK(s). Else throw error\n */\n const getJoinSnippet = array => {\n return array.map(key => {\n key = this.quoteIdentifier(key);\n return `${targetTableAlias}.${key} = ${sourceTableAlias}.${key}`;\n });\n };\n\n if (clauses.length === 0) {\n throw new Error('Primary Key or Unique key should be passed to upsert query');\n } else {\n // Search for primary key attribute in clauses -- Model can have two separate unique keys\n for (const key in clauses) {\n const keys = Object.keys(clauses[key]);\n if (primaryKeysAttrs.includes(keys[0])) {\n joinCondition = getJoinSnippet(primaryKeysAttrs).join(' AND ');\n break;\n }\n }\n if (!joinCondition) {\n joinCondition = getJoinSnippet(uniqueAttrs).join(' AND ');\n }\n }\n\n // Remove the IDENTITY_INSERT Column from update\n const filteredUpdateClauses = updateKeys.filter(key => !identityAttrs.includes(key))\n .map(key => {\n const value = this.escape(updateValues[key]);\n key = this.quoteIdentifier(key);\n return `${targetTableAlias}.${key} = ${value}`;\n });\n const updateSnippet = filteredUpdateClauses.length > 0 ? `WHEN MATCHED THEN UPDATE SET ${filteredUpdateClauses.join(', ')}` : '';\n\n const insertSnippet = `(${insertKeysQuoted}) VALUES(${insertValuesEscaped})`;\n\n let query = `MERGE INTO ${tableNameQuoted} WITH(HOLDLOCK) AS ${targetTableAlias} USING (${sourceTableQuery}) AS ${sourceTableAlias}(${insertKeysQuoted}) ON ${joinCondition}`;\n query += ` ${updateSnippet} WHEN NOT MATCHED THEN INSERT ${insertSnippet} OUTPUT $action, INSERTED.*;`;\n if (needIdentityInsertWrapper) {\n query = `SET IDENTITY_INSERT ${tableNameQuoted} ON; ${query} SET IDENTITY_INSERT ${tableNameQuoted} OFF;`;\n }\n return query;\n }\n\n truncateTableQuery(tableName) {\n return `TRUNCATE TABLE ${this.quoteTable(tableName)}`;\n }\n\n deleteQuery(tableName, where, options = {}, model) {\n const table = this.quoteTable(tableName);\n const whereClause = this.getWhereConditions(where, null, model, options);\n\n return Utils.joinSQLFragments([\n 'DELETE',\n options.limit && `TOP(${this.escape(options.limit)})`,\n 'FROM',\n table,\n whereClause && `WHERE ${whereClause}`,\n ';',\n 'SELECT @@ROWCOUNT AS AFFECTEDROWS',\n ';'\n ]);\n }\n\n showIndexesQuery(tableName) {\n return `EXEC sys.sp_helpindex @objname = N'${this.quoteTable(tableName)}';`;\n }\n\n showConstraintsQuery(tableName) {\n return `EXEC sp_helpconstraint @objname = ${this.escape(this.quoteTable(tableName))};`;\n }\n\n removeIndexQuery(tableName, indexNameOrAttributes) {\n let indexName = indexNameOrAttributes;\n\n if (typeof indexName !== 'string') {\n indexName = Utils.underscore(`${tableName}_${indexNameOrAttributes.join('_')}`);\n }\n\n return `DROP INDEX ${this.quoteIdentifiers(indexName)} ON ${this.quoteIdentifiers(tableName)}`;\n }\n\n attributeToSQL(attribute, options) {\n if (!_.isPlainObject(attribute)) {\n attribute = {\n type: attribute\n };\n }\n\n // handle self referential constraints\n if (attribute.references) {\n\n if (attribute.Model && attribute.Model.tableName === attribute.references.model) {\n this.sequelize.log('MSSQL does not support self referencial constraints, '\n + 'we will remove it but we recommend restructuring your query');\n attribute.onDelete = '';\n attribute.onUpdate = '';\n }\n }\n\n let template;\n\n if (attribute.type instanceof DataTypes.ENUM) {\n if (attribute.type.values && !attribute.values) attribute.values = attribute.type.values;\n\n // enums are a special case\n template = attribute.type.toSql();\n template += ` CHECK (${this.quoteIdentifier(attribute.field)} IN(${attribute.values.map(value => {\n return this.escape(value);\n }).join(', ') }))`;\n return template;\n }\n template = attribute.type.toString();\n\n if (attribute.allowNull === false) {\n template += ' NOT NULL';\n } else if (!attribute.primaryKey && !Utils.defaultValueSchemable(attribute.defaultValue)) {\n template += ' NULL';\n }\n\n if (attribute.autoIncrement) {\n template += ' IDENTITY(1,1)';\n }\n\n // Blobs/texts cannot have a defaultValue\n if (attribute.type !== 'TEXT' && attribute.type._binary !== true &&\n Utils.defaultValueSchemable(attribute.defaultValue)) {\n template += ` DEFAULT ${this.escape(attribute.defaultValue)}`;\n }\n\n if (attribute.unique === true) {\n template += ' UNIQUE';\n }\n\n if (attribute.primaryKey) {\n template += ' PRIMARY KEY';\n }\n\n if ((!options || !options.withoutForeignKeyConstraints) && attribute.references) {\n template += ` REFERENCES ${this.quoteTable(attribute.references.model)}`;\n\n if (attribute.references.key) {\n template += ` (${this.quoteIdentifier(attribute.references.key)})`;\n } else {\n template += ` (${this.quoteIdentifier('id')})`;\n }\n\n if (attribute.onDelete) {\n template += ` ON DELETE ${attribute.onDelete.toUpperCase()}`;\n }\n\n if (attribute.onUpdate) {\n template += ` ON UPDATE ${attribute.onUpdate.toUpperCase()}`;\n }\n }\n\n if (attribute.comment && typeof attribute.comment === 'string') {\n template += ` COMMENT ${attribute.comment}`;\n }\n\n return template;\n }\n\n attributesToSQL(attributes, options) {\n const result = {},\n existingConstraints = [];\n let key,\n attribute;\n\n for (key in attributes) {\n attribute = attributes[key];\n\n if (attribute.references) {\n if (existingConstraints.includes(attribute.references.model.toString())) {\n // no cascading constraints to a table more than once\n attribute.onDelete = '';\n attribute.onUpdate = '';\n } else {\n existingConstraints.push(attribute.references.model.toString());\n\n // NOTE: this really just disables cascading updates for all\n // definitions. Can be made more robust to support the\n // few cases where MSSQL actually supports them\n attribute.onUpdate = '';\n }\n\n }\n\n if (key && !attribute.field) attribute.field = key;\n result[attribute.field || key] = this.attributeToSQL(attribute, options);\n }\n\n return result;\n }\n\n createTrigger() {\n throwMethodUndefined('createTrigger');\n }\n\n dropTrigger() {\n throwMethodUndefined('dropTrigger');\n }\n\n renameTrigger() {\n throwMethodUndefined('renameTrigger');\n }\n\n createFunction() {\n throwMethodUndefined('createFunction');\n }\n\n dropFunction() {\n throwMethodUndefined('dropFunction');\n }\n\n renameFunction() {\n throwMethodUndefined('renameFunction');\n }\n\n /**\n * Generate common SQL prefix for ForeignKeysQuery.\n *\n * @param {string} catalogName\n * @returns {string}\n */\n _getForeignKeysQueryPrefix(catalogName) {\n return `${'SELECT ' +\n 'constraint_name = OBJ.NAME, ' +\n 'constraintName = OBJ.NAME, '}${\n catalogName ? `constraintCatalog = '${catalogName}', ` : ''\n }constraintSchema = SCHEMA_NAME(OBJ.SCHEMA_ID), ` +\n 'tableName = TB.NAME, ' +\n `tableSchema = SCHEMA_NAME(TB.SCHEMA_ID), ${\n catalogName ? `tableCatalog = '${catalogName}', ` : ''\n }columnName = COL.NAME, ` +\n `referencedTableSchema = SCHEMA_NAME(RTB.SCHEMA_ID), ${\n catalogName ? `referencedCatalog = '${catalogName}', ` : ''\n }referencedTableName = RTB.NAME, ` +\n 'referencedColumnName = RCOL.NAME ' +\n 'FROM sys.foreign_key_columns FKC ' +\n 'INNER JOIN sys.objects OBJ ON OBJ.OBJECT_ID = FKC.CONSTRAINT_OBJECT_ID ' +\n 'INNER JOIN sys.tables TB ON TB.OBJECT_ID = FKC.PARENT_OBJECT_ID ' +\n 'INNER JOIN sys.columns COL ON COL.COLUMN_ID = PARENT_COLUMN_ID AND COL.OBJECT_ID = TB.OBJECT_ID ' +\n 'INNER JOIN sys.tables RTB ON RTB.OBJECT_ID = FKC.REFERENCED_OBJECT_ID ' +\n 'INNER JOIN sys.columns RCOL ON RCOL.COLUMN_ID = REFERENCED_COLUMN_ID AND RCOL.OBJECT_ID = RTB.OBJECT_ID';\n }\n\n /**\n * Generates an SQL query that returns all foreign keys details of a table.\n *\n * @param {string|object} table\n * @param {string} catalogName database name\n * @returns {string}\n */\n getForeignKeysQuery(table, catalogName) {\n const tableName = table.tableName || table;\n let sql = `${this._getForeignKeysQueryPrefix(catalogName)\n } WHERE TB.NAME =${wrapSingleQuote(tableName)}`;\n\n if (table.schema) {\n sql += ` AND SCHEMA_NAME(TB.SCHEMA_ID) =${wrapSingleQuote(table.schema)}`;\n }\n return sql;\n }\n\n getForeignKeyQuery(table, attributeName) {\n const tableName = table.tableName || table;\n return Utils.joinSQLFragments([\n this._getForeignKeysQueryPrefix(),\n 'WHERE',\n `TB.NAME =${wrapSingleQuote(tableName)}`,\n 'AND',\n `COL.NAME =${wrapSingleQuote(attributeName)}`,\n table.schema && `AND SCHEMA_NAME(TB.SCHEMA_ID) =${wrapSingleQuote(table.schema)}`\n ]);\n }\n\n getPrimaryKeyConstraintQuery(table, attributeName) {\n const tableName = wrapSingleQuote(table.tableName || table);\n return Utils.joinSQLFragments([\n 'SELECT K.TABLE_NAME AS tableName,',\n 'K.COLUMN_NAME AS columnName,',\n 'K.CONSTRAINT_NAME AS constraintName',\n 'FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS AS C',\n 'JOIN INFORMATION_SCHEMA.KEY_COLUMN_USAGE AS K',\n 'ON C.TABLE_NAME = K.TABLE_NAME',\n 'AND C.CONSTRAINT_CATALOG = K.CONSTRAINT_CATALOG',\n 'AND C.CONSTRAINT_SCHEMA = K.CONSTRAINT_SCHEMA',\n 'AND C.CONSTRAINT_NAME = K.CONSTRAINT_NAME',\n 'WHERE C.CONSTRAINT_TYPE = \\'PRIMARY KEY\\'',\n `AND K.COLUMN_NAME = ${wrapSingleQuote(attributeName)}`,\n `AND K.TABLE_NAME = ${tableName}`,\n ';'\n ]);\n }\n\n dropForeignKeyQuery(tableName, foreignKey) {\n return Utils.joinSQLFragments([\n 'ALTER TABLE',\n this.quoteTable(tableName),\n 'DROP',\n this.quoteIdentifier(foreignKey)\n ]);\n }\n\n getDefaultConstraintQuery(tableName, attributeName) {\n const quotedTable = this.quoteTable(tableName);\n return Utils.joinSQLFragments([\n 'SELECT name FROM sys.default_constraints',\n `WHERE PARENT_OBJECT_ID = OBJECT_ID('${quotedTable}', 'U')`,\n `AND PARENT_COLUMN_ID = (SELECT column_id FROM sys.columns WHERE NAME = ('${attributeName}')`,\n `AND object_id = OBJECT_ID('${quotedTable}', 'U'))`,\n ';'\n ]);\n }\n\n dropConstraintQuery(tableName, constraintName) {\n return Utils.joinSQLFragments([\n 'ALTER TABLE',\n this.quoteTable(tableName),\n 'DROP CONSTRAINT',\n this.quoteIdentifier(constraintName),\n ';'\n ]);\n }\n\n setIsolationLevelQuery() {\n\n }\n\n generateTransactionId() {\n return randomBytes(10).toString('hex');\n }\n\n startTransactionQuery(transaction) {\n if (transaction.parent) {\n return `SAVE TRANSACTION ${this.quoteIdentifier(transaction.name)};`;\n }\n\n return 'BEGIN TRANSACTION;';\n }\n\n commitTransactionQuery(transaction) {\n if (transaction.parent) {\n return;\n }\n\n return 'COMMIT TRANSACTION;';\n }\n\n rollbackTransactionQuery(transaction) {\n if (transaction.parent) {\n return `ROLLBACK TRANSACTION ${this.quoteIdentifier(transaction.name)};`;\n }\n\n return 'ROLLBACK TRANSACTION;';\n }\n\n selectFromTableFragment(options, model, attributes, tables, mainTableAs, where) {\n this._throwOnEmptyAttributes(attributes, { modelName: model && model.name, as: mainTableAs });\n\n const dbVersion = this.sequelize.options.databaseVersion;\n const isSQLServer2008 = semver.valid(dbVersion) && semver.lt(dbVersion, '11.0.0');\n\n if (isSQLServer2008 && options.offset) {\n // For earlier versions of SQL server, we need to nest several queries\n // in order to emulate the OFFSET behavior.\n //\n // 1. The outermost query selects all items from the inner query block.\n // This is due to a limitation in SQL server with the use of computed\n // columns (e.g. SELECT ROW_NUMBER()...AS x) in WHERE clauses.\n // 2. The next query handles the LIMIT and OFFSET behavior by getting\n // the TOP N rows of the query where the row number is > OFFSET\n // 3. The innermost query is the actual set we want information from\n\n const offset = options.offset || 0;\n const isSubQuery = options.hasIncludeWhere || options.hasIncludeRequired || options.hasMultiAssociation;\n let orders = { mainQueryOrder: [] };\n if (options.order) {\n orders = this.getQueryOrders(options, model, isSubQuery);\n }\n\n if (orders.mainQueryOrder.length === 0) {\n orders.mainQueryOrder.push(this.quoteIdentifier(model.primaryKeyField));\n }\n\n const tmpTable = mainTableAs || 'OffsetTable';\n\n if (options.include) {\n const subQuery = options.subQuery === undefined ? options.limit && options.hasMultiAssociation : options.subQuery;\n const mainTable = {\n name: mainTableAs,\n quotedName: null,\n as: null,\n model\n };\n const topLevelInfo = {\n names: mainTable,\n options,\n subQuery\n };\n\n let mainJoinQueries = [];\n for (const include of options.include) {\n if (include.separate) {\n continue;\n }\n const joinQueries = this.generateInclude(include, { externalAs: mainTableAs, internalAs: mainTableAs }, topLevelInfo);\n mainJoinQueries = mainJoinQueries.concat(joinQueries.mainQuery);\n }\n\n return Utils.joinSQLFragments([\n 'SELECT TOP 100 PERCENT',\n attributes.join(', '),\n 'FROM (',\n [\n 'SELECT',\n options.limit && `TOP ${options.limit}`,\n '* FROM (',\n [\n 'SELECT ROW_NUMBER() OVER (',\n [\n 'ORDER BY',\n orders.mainQueryOrder.join(', ')\n ],\n `) as row_num, ${tmpTable}.* FROM (`,\n [\n 'SELECT DISTINCT',\n `${tmpTable}.* FROM ${tables} AS ${tmpTable}`,\n mainJoinQueries,\n where && `WHERE ${where}`\n ],\n `) AS ${tmpTable}`\n ],\n `) AS ${tmpTable} WHERE row_num > ${offset}`\n ],\n `) AS ${tmpTable}`\n ]);\n }\n return Utils.joinSQLFragments([\n 'SELECT TOP 100 PERCENT',\n attributes.join(', '),\n 'FROM (',\n [\n 'SELECT',\n options.limit && `TOP ${options.limit}`,\n '* FROM (',\n [\n 'SELECT ROW_NUMBER() OVER (',\n [\n 'ORDER BY',\n orders.mainQueryOrder.join(', ')\n ],\n `) as row_num, * FROM ${tables} AS ${tmpTable}`,\n where && `WHERE ${where}`\n ],\n `) AS ${tmpTable} WHERE row_num > ${offset}`\n ],\n `) AS ${tmpTable}`\n ]);\n }\n\n return Utils.joinSQLFragments([\n 'SELECT',\n isSQLServer2008 && options.limit && `TOP ${options.limit}`,\n attributes.join(', '),\n `FROM ${tables}`,\n mainTableAs && `AS ${mainTableAs}`,\n options.tableHint && TableHints[options.tableHint] && `WITH (${TableHints[options.tableHint]})`\n ]);\n }\n\n addLimitAndOffset(options, model) {\n // Skip handling of limit and offset as postfixes for older SQL Server versions\n if (semver.valid(this.sequelize.options.databaseVersion) && semver.lt(this.sequelize.options.databaseVersion, '11.0.0')) {\n return '';\n }\n\n const offset = options.offset || 0;\n const isSubQuery = options.subQuery === undefined\n ? options.hasIncludeWhere || options.hasIncludeRequired || options.hasMultiAssociation\n : options.subQuery;\n\n let fragment = '';\n let orders = {};\n\n if (options.order) {\n orders = this.getQueryOrders(options, model, isSubQuery);\n }\n\n if (options.limit || options.offset) {\n // TODO: document why this is adding the primary key of the model in ORDER BY\n // if options.include is set\n if (!options.order || options.order.length === 0 || options.include && orders.subQueryOrder.length === 0) {\n const tablePkFragment = `${this.quoteTable(options.tableAs || model.name)}.${this.quoteIdentifier(model.primaryKeyField)}`;\n if (!options.order || !options.order.length) {\n fragment += ` ORDER BY ${tablePkFragment}`;\n } else {\n const orderFieldNames = _.map(options.order, order => order[0]);\n const primaryKeyFieldAlreadyPresent = _.includes(orderFieldNames, model.primaryKeyField);\n\n if (!primaryKeyFieldAlreadyPresent) {\n fragment += options.order && !isSubQuery ? ', ' : ' ORDER BY ';\n fragment += tablePkFragment;\n }\n }\n }\n\n if (options.offset || options.limit) {\n fragment += ` OFFSET ${this.escape(offset)} ROWS`;\n }\n\n if (options.limit) {\n fragment += ` FETCH NEXT ${this.escape(options.limit)} ROWS ONLY`;\n }\n }\n\n return fragment;\n }\n\n booleanValue(value) {\n return value ? 1 : 0;\n }\n\n /**\n * Quote identifier in sql clause\n *\n * @param {string} identifier\n * @param {boolean} force\n *\n * @returns {string}\n */\n quoteIdentifier(identifier, force) {\n return `[${identifier.replace(/[[\\]']+/g, '')}]`;\n }\n}\n\n// private methods\nfunction wrapSingleQuote(identifier) {\n return Utils.addTicks(Utils.removeTicks(identifier, \"'\"), \"'\");\n}\n\nmodule.exports = MSSQLQueryGenerator;\n"], "mappings": ";;;;;;;;;;;;;;;;;AAEA,MAAM,IAAI,QAAQ;AAClB,MAAM,QAAQ,QAAQ;AACtB,MAAM,YAAY,QAAQ;AAC1B,MAAM,aAAa,QAAQ;AAC3B,MAAM,yBAAyB,QAAQ;AACvC,MAA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