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

Support for multiple queries per SQL file #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

radim
Copy link
Contributor

@radim radim commented Dec 21, 2020

Hi @dimitri

I have added support for multiple querier per SQL files as supported by other tools. It does support both the original single query per .sql file and multiple queries (each tagged individually).

  1. single queries support (if not tagged) uses name default
  2. otherwise named tag is used

The most significant change introduced by this PR is naming of the plan files (and other relevant files). New naming changes from query_file.ext to query_file-query_name.ext.

What are your thoughts on this? I understand you might have some particular idea in mind when going with the only single query per file approach. Would be interested to find out more.

If you are happy to go ahead - I would still have to update Example section of README.md.

Cheers!

Using the tag format `-- name: query_name`.
@dimitri
Copy link
Owner

dimitri commented Apr 12, 2021

Hi @radim ! Thanks for your contribution! do you want to enrol as a collaborator on this project and then have the chance to merge your PR yourself, and maybe maintain the project to some extend?

@radim
Copy link
Contributor Author

radim commented May 20, 2021

@dimitri sorry for late response. That would be awesome! In my spare time I'm working on stack to support easier development cycle for Go based projects and regresql is big part of it

@rudaporto
Copy link

@radim and @dimitri is there a reason why this PR was never merged?

I'm looking into starting using regresql and it would be important to have support for multiple queries per SQL file.

I have some Golang experience and could help with code, tests, and documentation.

Thank you!

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

Successfully merging this pull request may close these issues.

3 participants