API/api.medcify.app/node_modules/sequelize/lib/dialects/sqlite/query.js.map
2022-09-26 11:41:44 +05:30

8 lines
22 KiB
Plaintext

{
"version": 3,
"sources": ["../../../src/dialects/sqlite/query.js"],
"sourcesContent": ["'use strict';\n\nconst _ = require('lodash');\nconst Utils = require('../../utils');\nconst AbstractQuery = require('../abstract/query');\nconst QueryTypes = require('../../query-types');\nconst sequelizeErrors = require('../../errors');\nconst parserStore = require('../parserStore')('sqlite');\nconst { logger } = require('../../utils/logger');\n\nconst debug = logger.debugContext('sql:sqlite');\n\n\nclass Query extends AbstractQuery {\n getInsertIdField() {\n return 'lastID';\n }\n\n /**\n * rewrite query with parameters.\n *\n * @param {string} sql\n * @param {Array|object} values\n * @param {string} dialect\n * @private\n */\n static formatBindParameters(sql, values, dialect) {\n let bindParam;\n if (Array.isArray(values)) {\n bindParam = {};\n values.forEach((v, i) => {\n bindParam[`$${i + 1}`] = v;\n });\n sql = AbstractQuery.formatBindParameters(sql, values, dialect, { skipValueReplace: true })[0];\n } else {\n bindParam = {};\n if (typeof values === 'object') {\n for (const k of Object.keys(values)) {\n bindParam[`$${k}`] = values[k];\n }\n }\n sql = AbstractQuery.formatBindParameters(sql, values, dialect, { skipValueReplace: true })[0];\n }\n return [sql, bindParam];\n }\n\n _collectModels(include, prefix) {\n const ret = {};\n\n if (include) {\n for (const _include of include) {\n let key;\n if (!prefix) {\n key = _include.as;\n } else {\n key = `${prefix}.${_include.as}`;\n }\n ret[key] = _include.model;\n\n if (_include.include) {\n _.merge(ret, this._collectModels(_include.include, key));\n }\n }\n }\n\n return ret;\n }\n\n _handleQueryResponse(metaData, columnTypes, err, results, errStack) {\n if (err) {\n err.sql = this.sql;\n throw this.formatError(err, errStack);\n }\n let result = this.instance;\n\n // add the inserted row id to the instance\n if (this.isInsertQuery(results, metaData) || this.isUpsertQuery()) {\n this.handleInsertQuery(results, metaData);\n if (!this.instance) {\n // handle bulkCreate AI primary key\n if (\n metaData.constructor.name === 'Statement'\n && this.model\n && this.model.autoIncrementAttribute\n && this.model.autoIncrementAttribute === this.model.primaryKeyAttribute\n && this.model.rawAttributes[this.model.primaryKeyAttribute]\n ) {\n const startId = metaData[this.getInsertIdField()] - metaData.changes + 1;\n result = [];\n for (let i = startId; i < startId + metaData.changes; i++) {\n result.push({ [this.model.rawAttributes[this.model.primaryKeyAttribute].field]: i });\n }\n } else {\n result = metaData[this.getInsertIdField()];\n }\n }\n }\n\n if (this.isShowTablesQuery()) {\n return results.map(row => row.name);\n }\n if (this.isShowConstraintsQuery()) {\n result = results;\n if (results && results[0] && results[0].sql) {\n result = this.parseConstraintsFromSql(results[0].sql);\n }\n return result;\n }\n if (this.isSelectQuery()) {\n if (this.options.raw) {\n return this.handleSelectQuery(results);\n }\n // This is a map of prefix strings to models, e.g. user.projects -> Project model\n const prefixes = this._collectModels(this.options.include);\n\n results = results.map(result => {\n return _.mapValues(result, (value, name) => {\n let model;\n if (name.includes('.')) {\n const lastind = name.lastIndexOf('.');\n\n model = prefixes[name.substr(0, lastind)];\n\n name = name.substr(lastind + 1);\n } else {\n model = this.options.model;\n }\n\n const tableName = model.getTableName().toString().replace(/`/g, '');\n const tableTypes = columnTypes[tableName] || {};\n\n if (tableTypes && !(name in tableTypes)) {\n // The column is aliased\n _.forOwn(model.rawAttributes, (attribute, key) => {\n if (name === key && attribute.field) {\n name = attribute.field;\n return false;\n }\n });\n }\n\n return Object.prototype.hasOwnProperty.call(tableTypes, name)\n ? this.applyParsers(tableTypes[name], value)\n : value;\n });\n });\n\n return this.handleSelectQuery(results);\n }\n if (this.isShowOrDescribeQuery()) {\n return results;\n }\n if (this.sql.includes('PRAGMA INDEX_LIST')) {\n return this.handleShowIndexesQuery(results);\n }\n if (this.sql.includes('PRAGMA INDEX_INFO')) {\n return results;\n }\n if (this.sql.includes('PRAGMA TABLE_INFO')) {\n // this is the sqlite way of getting the metadata of a table\n result = {};\n\n let defaultValue;\n for (const _result of results) {\n if (_result.dflt_value === null) {\n // Column schema omits any \"DEFAULT ...\"\n defaultValue = undefined;\n } else if (_result.dflt_value === 'NULL') {\n // Column schema is a \"DEFAULT NULL\"\n defaultValue = null;\n } else {\n defaultValue = _result.dflt_value;\n }\n\n result[_result.name] = {\n type: _result.type,\n allowNull: _result.notnull === 0,\n defaultValue,\n primaryKey: _result.pk !== 0\n };\n\n if (result[_result.name].type === 'TINYINT(1)') {\n result[_result.name].defaultValue = { '0': false, '1': true }[result[_result.name].defaultValue];\n }\n\n if (typeof result[_result.name].defaultValue === 'string') {\n result[_result.name].defaultValue = result[_result.name].defaultValue.replace(/'/g, '');\n }\n }\n return result;\n }\n if (this.sql.includes('PRAGMA foreign_keys;')) {\n return results[0];\n }\n if (this.sql.includes('PRAGMA foreign_keys')) {\n return results;\n }\n if (this.sql.includes('PRAGMA foreign_key_list')) {\n return results;\n }\n if ([QueryTypes.BULKUPDATE, QueryTypes.BULKDELETE].includes(this.options.type)) {\n return metaData.changes;\n }\n if (this.options.type === QueryTypes.VERSION) {\n return results[0].version;\n }\n if (this.options.type === QueryTypes.RAW) {\n return [results, metaData];\n }\n if (this.isUpsertQuery()) {\n return [result, null];\n }\n if (this.isUpdateQuery() || this.isInsertQuery()) {\n return [result, metaData.changes];\n }\n return result;\n }\n\n async run(sql, parameters) {\n const conn = this.connection;\n this.sql = sql;\n const method = this.getDatabaseMethod();\n const complete = this._logQuery(sql, debug, parameters);\n\n return new Promise((resolve, reject) => conn.serialize(async () => {\n const columnTypes = {};\n const errForStack = new Error();\n const executeSql = () => {\n if (sql.startsWith('-- ')) {\n return resolve();\n }\n const query = this;\n // cannot use arrow function here because the function is bound to the statement\n function afterExecute(executionError, results) {\n try {\n complete();\n // `this` is passed from sqlite, we have no control over this.\n // eslint-disable-next-line no-invalid-this\n resolve(query._handleQueryResponse(this, columnTypes, executionError, results, errForStack.stack));\n return;\n } catch (error) {\n reject(error);\n }\n }\n\n if (!parameters) parameters = [];\n conn[method](sql, parameters, afterExecute);\n\n return null;\n };\n\n if (this.getDatabaseMethod() === 'all') {\n let tableNames = [];\n if (this.options && this.options.tableNames) {\n tableNames = this.options.tableNames;\n } else if (/FROM `(.*?)`/i.exec(this.sql)) {\n tableNames.push(/FROM `(.*?)`/i.exec(this.sql)[1]);\n }\n\n // If we already have the metadata for the table, there's no need to ask for it again\n tableNames = tableNames.filter(tableName => !(tableName in columnTypes) && tableName !== 'sqlite_master');\n\n if (!tableNames.length) {\n return executeSql();\n }\n await Promise.all(tableNames.map(tableName =>\n new Promise(resolve => {\n tableName = tableName.replace(/`/g, '');\n columnTypes[tableName] = {};\n\n conn.all(`PRAGMA table_info(\\`${tableName}\\`)`, (err, results) => {\n if (!err) {\n for (const result of results) {\n columnTypes[tableName][result.name] = result.type;\n }\n }\n resolve();\n });\n })));\n }\n return executeSql();\n }));\n }\n\n parseConstraintsFromSql(sql) {\n let constraints = sql.split('CONSTRAINT ');\n let referenceTableName, referenceTableKeys, updateAction, deleteAction;\n constraints.splice(0, 1);\n constraints = constraints.map(constraintSql => {\n //Parse foreign key snippets\n if (constraintSql.includes('REFERENCES')) {\n //Parse out the constraint condition form sql string\n updateAction = constraintSql.match(/ON UPDATE (CASCADE|SET NULL|RESTRICT|NO ACTION|SET DEFAULT){1}/);\n deleteAction = constraintSql.match(/ON DELETE (CASCADE|SET NULL|RESTRICT|NO ACTION|SET DEFAULT){1}/);\n\n if (updateAction) {\n updateAction = updateAction[1];\n }\n\n if (deleteAction) {\n deleteAction = deleteAction[1];\n }\n\n const referencesRegex = /REFERENCES.+\\((?:[^)(]+|\\((?:[^)(]+|\\([^)(]*\\))*\\))*\\)/;\n const referenceConditions = constraintSql.match(referencesRegex)[0].split(' ');\n referenceTableName = Utils.removeTicks(referenceConditions[1]);\n let columnNames = referenceConditions[2];\n columnNames = columnNames.replace(/\\(|\\)/g, '').split(', ');\n referenceTableKeys = columnNames.map(column => Utils.removeTicks(column));\n }\n\n const constraintCondition = constraintSql.match(/\\((?:[^)(]+|\\((?:[^)(]+|\\([^)(]*\\))*\\))*\\)/)[0];\n constraintSql = constraintSql.replace(/\\(.+\\)/, '');\n const constraint = constraintSql.split(' ');\n\n if (['PRIMARY', 'FOREIGN'].includes(constraint[1])) {\n constraint[1] += ' KEY';\n }\n\n return {\n constraintName: Utils.removeTicks(constraint[0]),\n constraintType: constraint[1],\n updateAction,\n deleteAction,\n sql: sql.replace(/\"/g, '`'), //Sqlite returns double quotes for table name\n constraintCondition,\n referenceTableName,\n referenceTableKeys\n };\n });\n\n return constraints;\n }\n\n applyParsers(type, value) {\n if (type.includes('(')) {\n // Remove the length part\n type = type.substr(0, type.indexOf('('));\n }\n type = type.replace('UNSIGNED', '').replace('ZEROFILL', '');\n type = type.trim().toUpperCase();\n const parse = parserStore.get(type);\n\n if (value !== null && parse) {\n return parse(value, { timezone: this.sequelize.options.timezone });\n }\n return value;\n }\n\n formatError(err, errStack) {\n\n switch (err.code) {\n case 'SQLITE_CONSTRAINT_UNIQUE':\n case 'SQLITE_CONSTRAINT_PRIMARYKEY':\n case 'SQLITE_CONSTRAINT_TRIGGER':\n case 'SQLITE_CONSTRAINT_FOREIGNKEY':\n case 'SQLITE_CONSTRAINT': {\n if (err.message.includes('FOREIGN KEY constraint failed')) {\n return new sequelizeErrors.ForeignKeyConstraintError({\n parent: err,\n stack: errStack\n });\n }\n\n let fields = [];\n\n // Sqlite pre 2.2 behavior - Error: SQLITE_CONSTRAINT: columns x, y are not unique\n let match = err.message.match(/columns (.*?) are/);\n if (match !== null && match.length >= 2) {\n fields = match[1].split(', ');\n } else {\n\n // Sqlite post 2.2 behavior - Error: SQLITE_CONSTRAINT: UNIQUE constraint failed: table.x, table.y\n match = err.message.match(/UNIQUE constraint failed: (.*)/);\n if (match !== null && match.length >= 2) {\n fields = match[1].split(', ').map(columnWithTable => columnWithTable.split('.')[1]);\n }\n }\n\n const errors = [];\n let message = 'Validation error';\n\n for (const field of fields) {\n errors.push(new sequelizeErrors.ValidationErrorItem(\n this.getUniqueConstraintErrorMessage(field),\n 'unique violation', // sequelizeErrors.ValidationErrorItem.Origins.DB,\n field,\n this.instance && this.instance[field],\n this.instance,\n 'not_unique'\n ));\n }\n\n if (this.model) {\n _.forOwn(this.model.uniqueKeys, constraint => {\n if (_.isEqual(constraint.fields, fields) && !!constraint.msg) {\n message = constraint.msg;\n return false;\n }\n });\n }\n\n return new sequelizeErrors.UniqueConstraintError({ message, errors, parent: err, fields, stack: errStack });\n }\n case 'SQLITE_BUSY':\n return new sequelizeErrors.TimeoutError(err, { stack: errStack });\n\n default:\n return new sequelizeErrors.DatabaseError(err, { stack: errStack });\n }\n }\n\n async handleShowIndexesQuery(data) {\n // Sqlite returns indexes so the one that was defined last is returned first. Lets reverse that!\n return Promise.all(data.reverse().map(async item => {\n item.fields = [];\n item.primary = false;\n item.unique = !!item.unique;\n item.constraintName = item.name;\n const columns = await this.run(`PRAGMA INDEX_INFO(\\`${item.name}\\`)`);\n for (const column of columns) {\n item.fields[column.seqno] = {\n attribute: column.name,\n length: undefined,\n order: undefined\n };\n }\n\n return item;\n }));\n }\n\n getDatabaseMethod() {\n if (this.isInsertQuery() || this.isUpdateQuery() || this.isUpsertQuery() || this.isBulkUpdateQuery() || this.sql.toLowerCase().includes('CREATE TEMPORARY TABLE'.toLowerCase()) || this.options.type === QueryTypes.BULKDELETE) {\n return 'run';\n }\n return 'all';\n }\n}\n\nmodule.exports = Query;\nmodule.exports.Query = Query;\nmodule.exports.default = Query;\n"],
"mappings": ";AAEA,MAAM,IAAI,QAAQ;AAClB,MAAM,QAAQ,QAAQ;AACtB,MAAM,gBAAgB,QAAQ;AAC9B,MAAM,aAAa,QAAQ;AAC3B,MAAM,kBAAkB,QAAQ;AAChC,MAAM,cAAc,QAAQ,kBAAkB;AAC9C,MAAM,EAAE,WAAW,QAAQ;AAE3B,MAAM,QAAQ,OAAO,aAAa;AAGlC,oBAAoB,cAAc;AAAA,EAChC,mBAAmB;AACjB,WAAO;AAAA;AAAA,SAWF,qBAAqB,KAAK,QAAQ,SAAS;AAChD,QAAI;AACJ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