Skip to content

Code Generation in Quick SQL Creates Randomly Ordered Tables, Leading to Script Execution Failures #72

Open
@pallasinfotech

Description

@pallasinfotech

When generating SQL code in Quick SQL, the tool currently produces table creation statements in a the order it appears in the QuickSQL side order. This approach often results in dependency issues where a table that references another table is created before the referenced table, causing the script to fail upon execution.

It would be highly beneficial if Quick SQL could automatically analyze table dependencies and adjust the order of table creation accordingly. Specifically, the tool should:

Generate tables without dependencies first.
Follow with tables that reference other tables, ensuring referenced tables are created prior to the dependent ones.
This enhancement would ensure that even large models can be executed without manual intervention, improving efficiency and reliability.

Use Case:
Quick SQL is an incredibly powerful tool that significantly reduces development time while ensuring the accuracy of triggers and packages. However, when working with medium to large models (e.g., 50 or 100 tables tables), the current behavior of generating SQL statements in a random order creates substantial overhead.

In my case, every time I regenerate SQL for my 62-table model, the table creation order changes. As a result, running the script fails unless I manually reorder the CREATE TABLE statements. This manual step negates some of the time-saving benefits Quick SQL is meant to provide.

Implementing dependency-aware script generation would eliminate this issue, allowing developers to focus more on design and less on troubleshooting script execution.

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions