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

Iterate over multiple SQL files from Directory and validate syntax #674

Open
shiv24saxena opened this issue Jan 20, 2022 · 8 comments
Open
Milestone

Comments

@shiv24saxena
Copy link

Hi,

I have multiple SQL files (contain create view statement) in a directory, whose syntax I want to validate through NBi. However I am not able to iterate over the files and pass it to my query execution. Below is the snippet of my testsuite.

image

@Seddryck
Copy link
Owner

What's the error that you're receiving with this snippet?

@shiv24saxena
Copy link
Author

Thanks Seddryck for your response. It's not able to resolve file path (see attached screenshot). Files are present in C:/Test directory so in file attribute of query section I should get C:/TEST/DIM_ABC_VIEW.sql for DIM_ABC_VIEW.sql & C:/Test/DIM_ADJ_VIEW.sql for DIM_ADJ_VIEW.sql
image

@Seddryck
Copy link
Owner

Have you tried to use file="~{@sqlview}" ?

See doc at http://www.nbi.io/docs/primitive-result-set/#external-definition

@shiv24saxena
Copy link
Author

Yes, I tried, It throws similar error. Framework is not able to resolve variable in file attribute.
image

image

@Seddryck
Copy link
Owner

Huuum, i think that the variables are not supported for execution. Something to add in framework.

@shiv24saxena
Copy link
Author

Thanks for the reply. Is there any way to meet the below requirement with NBi?
"Validate Syntax of multiple view , by reading definition from SQL files (1 file per view) present in a directory"

@Seddryck
Copy link
Owner

Seddryck commented Feb 6, 2022

Unfortunately not and I'm really busy with a huge migration to the v2.0 of NBi so I won't include this soon. But I'm adding that as a feature of v2.1

@Seddryck Seddryck added this to the v2.1 milestone Feb 6, 2022
@Seddryck Seddryck changed the title Help: Read multiple SQL files from Directory and validate syntax Iterate over multiple SQL files from Directory and validate syntax Feb 6, 2022
@shiv24saxena
Copy link
Author

Thanks. Eagerly waiting for new major release 2.0, any tentative release date :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants