-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
enhancementNew feature or requestNew feature or request
Description
For my project, I'm currently trying to use pytsql for use cases beyond replacing DB or table names. In particular, I want to make use of conditionals.
However, I run into some issues there:
- Executing certain functions within conditionals throws me (an) unexpected error(s)
- E.g., if you want to parameterize whether a certain table or a view is created. For views, I use the following approach:
IF 1 = 1
BEGIN
SET NONEXEC ON
END
GO
CREATE VIEW v AS ...
SET NONEXEC OFF
... however, pytsql indirectly throws me an unexpected error via sqlalchemy:
sqlalchemy.exec.ResourceClosedError: This result object does not return rows. It has been closed automatically. (If it's helpful I can also post the full error, but that requires some anonymization first)
- Declaring variables within the conditional seems current not possible.
- while there is an obvious workaround by declaring every variable at the top of the file,
pytsqls behavior is unexpected - I believe this is already addressed in issue
SETstatements for local variables are unreliable #19
- while there is an obvious workaround by declaring every variable at the top of the file,
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request