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 working with MSSQL, certain object names may be reserved keywords (e.g. USER, GROUP), which can cause conflicts or errors when generating and running the SQL scripts. Currently, qss does not automatically wrap object names in square brackets. As a result, developers must manually edit the generated scripts or avoid using keywords as object names, which may not always be feasible.
Request:
Introduce a --bracket (or similar) command-line argument. When enabled, qss would wrap all object names (tables, columns, triggers, stored procedures, and foreign keys) in square brackets for MSSQL. This would ensure that even reserved keywords are treated as identifiers rather than reserved words, preventing SQL parsing errors and saving time on manual script edits.
Justification:
Reserved Keywords in MSSQL:
Certain words cannot be used as identifiers unless properly escaped. By adding square brackets (e.g., [USER], [GROUP]), you can safely create objects with these names.
Consistency and Automation:
With a --bracket / --br option, users don’t have to worry about manually editing generated scripts to add brackets. This ensures consistent naming conventions and reduces the chance of errors.
Example:
Command without --bracket:
qss mssql User sp:* c:USERNAME,nvarchar(50),nnu c:EMAIL,nvarchar(255),nnu
Feature Request: Add a
--bracket
OptionDescription:
When working with MSSQL, certain object names may be reserved keywords (e.g.
USER
,GROUP
), which can cause conflicts or errors when generating and running the SQL scripts. Currently,qss
does not automatically wrap object names in square brackets. As a result, developers must manually edit the generated scripts or avoid using keywords as object names, which may not always be feasible.Request:
Introduce a
--bracket
(or similar) command-line argument. When enabled,qss
would wrap all object names (tables, columns, triggers, stored procedures, and foreign keys) in square brackets for MSSQL. This would ensure that even reserved keywords are treated as identifiers rather than reserved words, preventing SQL parsing errors and saving time on manual script edits.Justification:
Reserved Keywords in MSSQL:
Certain words cannot be used as identifiers unless properly escaped. By adding square brackets (e.g.,
[USER]
,[GROUP]
), you can safely create objects with these names.Consistency and Automation:
With a
--bracket
/--br
option, users don’t have to worry about manually editing generated scripts to add brackets. This ensures consistent naming conventions and reduces the chance of errors.Example:
Command without
--bracket
:qss mssql User sp:* c:USERNAME,nvarchar(50),nnu c:EMAIL,nvarchar(255),nnu
Might generate procedures and references like:
If
USER
is considered a reserved keyword in this environment, this might cause issues.Command with
--bracket
:qss mssql User --bracket sp:* c:USERNAME,nvarchar(50),nnu c:EMAIL,nvarchar(255),nnu
Would generate:
And when referencing this table from another:
This ensures that the generated scripts run smoothly even if reserved words are used as identifiers.
The text was updated successfully, but these errors were encountered: