You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When loading foreign keys of a table, I get this error Cannot read property 'name' of undefined. It's because foreign keys mapping can't be found. I looked a bit deeper and found that the regex for foreign keys didn't match the CREATE TABLE sql because the regex expects a space between FOREIGN KEY and the list of columns.
As stated in SQLite documentation (https://www.sqlite.org/foreignkeys.html), the space is not mandatory:
Issue Description
When loading foreign keys of a table, I get this error
Cannot read property 'name' of undefined
. It's because foreign keys mapping can't be found. I looked a bit deeper and found that the regex for foreign keys didn't match theCREATE TABLE
sql because the regex expects a space betweenFOREIGN KEY
and the list of columns.As stated in SQLite documentation (https://www.sqlite.org/foreignkeys.html), the space is not mandatory:
I've tested the regex in the code on regex101.com with the example provided by SQLite and it does not match.
Expected Behavior
The regex should handle both space and no-space syntaxes and it should successfully match the
CREATE TABLE
sql to get the foreign keys.Actual Behavior
Cannot read property 'name' of undefined / AbstractSQLiteQueryRunner.ts
, line 1510.Steps to Reproduce
loadTable
on itMy Environment
Additional Context
Relevant Database Driver(s)
aurora-mysql
aurora-postgres
better-sqlite3
cockroachdb
cordova
expo
mongodb
mysql
nativescript
oracle
postgres
react-native
sap
spanner
sqlite
sqlite-abstract
sqljs
sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
The text was updated successfully, but these errors were encountered: