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

Capture, or show, output from SQL Scripts #594

Open
philcart opened this issue Oct 29, 2024 · 1 comment
Open

Capture, or show, output from SQL Scripts #594

philcart opened this issue Oct 29, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@philcart
Copy link

A few of our scripts, particularly those run after migration, maintain seed data.

These scripts have standard SQL PRINT statements showing if actions are being taken.
eg:

PRINT 'Inserted n new division codes';

Currently Grate shows the script being executed, but there is no output from the script.

Looking for AfterMigration scripts in "script folder". These scripts will run every time.
--------------------------------------------------------------------------------
 Running 'my script to run.sql'.
--------------------------------------------------------------------------------

Is it possible to have that output show up somewhere?

@erikbra
Copy link
Owner

erikbra commented Jan 19, 2025

Good question. I personally don't have much experience with capturing stdout from SQL scripts back in calling code. But I would guess this is definitely database specific. For SQL Server, it looks like the InfoMessage on the connection can be used. But I'm not sure how to do this on other DB connections.

If we collect info on how to collect the output from each database provider, we could always try to implement this feature, and display it as debug- or trace-level messages, perhaps?

@erikbra erikbra added the enhancement New feature or request label Jan 19, 2025
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

2 participants