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

Add boolean prql.addTargetDialectToSqlFilenames setting for the generated SQL filenames #103

Closed
RandomFractals opened this issue Feb 16, 2023 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@RandomFractals
Copy link
Collaborator

RandomFractals commented Feb 16, 2023

to enable users targeting different DBMS systems to create .sql files with the target db/platform filename suffix.

For example, sql file generated from some invoices-total.prql for the duckdb target will be named invoices-total.duckdb.sql.

The same user can then change prql.target to SQLite, create and save somewhat different invoices-total.sqlite.sql file and add it to their project version control system.

In both scenarios we just add sql dialect suffix before .sql file extension name when generating sql files via #42 feature.

To keep it simple, we'll default this setting to false, and advanced users can change it in their workspace settings.

Note: we'll do this for all the supported SQL system dialects, and skip adding this sql filename suffix when the current workspace prql.target setting is Generic or None recently added in #98.

@RandomFractals RandomFractals added the enhancement New feature or request label Feb 16, 2023
@RandomFractals RandomFractals self-assigned this Feb 16, 2023
@RandomFractals RandomFractals changed the title Add boolean prql.addTargetSqlDialectFilenamePrefix setting for the generated SQL files Add boolean prql.addTargetSqlDialectFilenamePrefix setting for the generated SQL filenames Feb 16, 2023
@RandomFractals RandomFractals changed the title Add boolean prql.addTargetSqlDialectFilenamePrefix setting for the generated SQL filenames Add boolean prql.addTargetSqlDialectFilenameSuffix setting for the generated SQL filenames Feb 16, 2023
@RandomFractals RandomFractals changed the title Add boolean prql.addTargetSqlDialectFilenameSuffix setting for the generated SQL filenames Add boolean prql.addTargetDialectToSqlFilenames setting for the generated SQL filenames Feb 16, 2023
@RandomFractals
Copy link
Collaborator Author

Example of using this new setting:

multi-target-sql-files

@max-sixty
Copy link
Member

My guess is that this won't be used that much — folks generally have a single DB they're working with. But no harm in adding

(does VSCode share any telemetry so we can see who is using what settings?)

@RandomFractals
Copy link
Collaborator Author

I can see folks using some transactional db and duckdb for analytics use this feature in some form or the other.

We can set up telemetry later. I don't think we have enough active users to start logging what features are used, or how many times sql preview is shown.

VSCode does have standard telemetry api, but that might require setting up Azure service, or do it with google analytics. i.e. much larger want/ask that should be written down as a separate ticket for us to consider adding it.

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