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
It appears that there’s an issue in metadata.js when processing foreign key constraints. Specifically, the error TypeError: Cannot read properties of null (reading '1') suggests that a null value is being accessed within the constraint.sql.match function on line 88.
duckerd -d /path/mydb -o /path/erd.png -f png -t neutral -w 1600
Generating ERD diagram...
/Users/xxx/.nvm/versions/node/v22.11.0/lib/node_modules/duckerd/dist/lib/metadata.js:88
}\n${table.constraints?.filter((constraint) => constraint.constraintType === "FOREIGN KEY").map((constraint) => ` "${table.databaseName}.${constraint.sql.match(/(?:^|)REFERENCES\s([^*]+?)\b\(/i)[1]}" ||--o{ "${table.databaseName}.${table.name}" : has`).join("\n")}`;
TypeError: Cannot read properties of null (reading '1')
at /Users/xxx/.nvm/versions/node/v22.11.0/lib/node_modules/duckerd/dist/lib/metadata.js:88:202
at Array.map (<anonymous>)
at /Users/xxx/.nvm/versions/node/v22.11.0/lib/node_modules/duckerd/dist/lib/metadata.js:88:97
at Array.map (<anonymous>)
at generateMermaidCodeForAllDBs (/Users/xxx/.nvm/versions/node/v22.11.0/lib/node_modules/duckerd/dist/lib/metadata.js:85:35)
at createERD (/Users/xxx/.nvm/versions/node/v22.11.0/lib/node_modules/duckerd/dist/commands/erd.js:11:69)
at async run (/Users/xxx/.nvm/versions/node/v22.11.0/lib/node_modules/duckerd/dist/index.js:53:28)
The text was updated successfully, but these errors were encountered:
It appears that there’s an issue in metadata.js when processing foreign key constraints. Specifically, the error TypeError: Cannot read properties of null (reading '1') suggests that a null value is being accessed within the constraint.sql.match function on line 88.
The text was updated successfully, but these errors were encountered: