Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend support for conditionals #42

Open
svengiegerich opened this issue Nov 22, 2022 · 0 comments
Open

Extend support for conditionals #42

svengiegerich opened this issue Nov 22, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@svengiegerich
Copy link
Contributor

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.
@svengiegerich svengiegerich changed the title Conditionals supporting certain use cases Extend support for conditionals Dec 15, 2022
@svengiegerich svengiegerich added the enhancement New feature or request label Jan 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant