Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

script in Custom Queries? #784

Closed
alpglide opened this issue Mar 19, 2023 · 4 comments
Closed

script in Custom Queries? #784

alpglide opened this issue Mar 19, 2023 · 4 comments
Labels

Comments

@alpglide
Copy link

alpglide commented Mar 19, 2023

Custom Queries are really helpful.
It's not always that easy to do everything in one sql.
I know there is plugin. any more plugin examples? like how to query the database (for example call preset custom queries inside plugin)? golang is new to me.

just notice that elements in output of inFormat always come with quote,for example, {{inFormat "name"}} --> ('1','2','3'), not (1,2,3) while &name=1&name=2&name=3.
Anyway to remove those quote?

@vmesel
Copy link
Member

vmesel commented Mar 19, 2023

Hey @alpglide! They come as quotes because URL fields are strings whenever you pull them.

One way you can use this data is casting it, which is costly, but depending on the table size, it’s a worthy try.

@alpglide
Copy link
Author

alpglide commented Mar 19, 2023

Hey @alpglide! They come as quotes because URL fields are strings whenever you pull them.

One way you can use this data is casting it, which is costly, but depending on the table size, it’s a worthy try.

yes, it works. your help is appreciated!

@arxdsilva
Copy link
Member

arxdsilva commented Mar 20, 2023

It's not always that easy to do everything in one sql.

@alpglide it is also possible to do multiple queries within the same sql file, just like this:

WITH pre_query AS ( SELECT * FROM <table> WHERE <conditions>)

SELECT * FROM <table2>
WHERE <table2>.ID=pre_query.ID
AND <conditions2>

@alpglide
Copy link
Author

Yes, that's my preferred way. but other team members do not want to do so. They believe it's hard to understand and maintenance. :)

@prest prest locked and limited conversation to collaborators Mar 21, 2023
@avelino avelino converted this issue into discussion #785 Mar 21, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

3 participants