Repository navigation
Adds support for querying sqlite_master table - #9645
Conversation
| let createTableSql; | ||
|
|
||
| return this.sequelize.query(describeCreateTableSql, options) | ||
| return this.sequelize.query(describeCreateTableSql, { type: QueryTypes.SELECT, raw: true }) |
There was a problem hiding this comment.
We should pass other options, probably { type: QueryTypes.SELECT, raw: true, ...options }
There was a problem hiding this comment.
That seemed to make things fail (although I never did try to figure out why). options was always something like
{ type: 'unique', fields: [ 'email' ] }I believe options is meant to be the options to create the constraint, not just general query options. Are there some specific properties I could pick out? I wasn't really sure of what the possibilities were.
|
@sushantdhiman You probably already realized this, but it just occurred to me that this will be a breaking change for any query that involves the string |
Pull Request check-list
npm run testornpm run test-DIALECTpass with this change (including linting)?Description of change
Raw queries to the
sqlite_mastertable were being special-cased and as such would return inconsistent values. For example,SELECT * FROM sqlite_masterwould simply return an array populated with just the value in thenamecolumn. This change allows you to query thesqlite_masterjust like any other table, and removes hardcoded SQL string checks in favor of using theQueryTypesenum.This is related to #1612 and #8769. Previous workarounds were to shove the
sqlite_mastertable into a view so that its table name wouldn't be caught by theindexOfcheck and query the view instead.This changeset also fixes a DataTypes test that was failing due to timezone issues.