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

Repository/collection of SQL scripts #4065

Closed
pawelsalawa opened this issue Apr 13, 2021 · 10 comments
Closed

Repository/collection of SQL scripts #4065

pawelsalawa opened this issue Apr 13, 2021 · 10 comments
Labels
enhancement New feature or request
Milestone

Comments

@pawelsalawa
Copy link
Owner

It would be nice to have global SQL editor scripts, not associated with a specific database, saved in SQLite database which is automatically attached/connected at application launch.

Perhaps it could work as a "code snippets" too (i.e. small script easily accessible with some context menu, or from code assistant).

@JrgMyr
Copy link
Contributor

JrgMyr commented Apr 14, 2021

Would be nice if that allows to store queries with parameters and update queries.

@audiomuze
Copy link

This would be a great addition. I have many code snippets and entire scripts comprising 100's of lines that I reuse periodically. Managing them within SQLiteStudio's "windows" capability is not a great experience - too easy to accidentally close a window and lose the code (there's even a option to close all windows and lose all code in one action) and no way to easily sort or organise them by project etc).

Ideally one would b able to associate databases and scripts with a particular project and also have a code/ script repository which enables code to be checked in and then imported into projects as required. The version checked into a project would live within the project and not have any relationship with the code/script repository unless explicitly checked back in or added as a new entry.

@pawelsalawa pawelsalawa added this to the 3.4.0 milestone Sep 15, 2021
@sa2000a
Copy link

sa2000a commented Nov 2, 2021

Hi - if it is easier, I would be happy with an export feature to export all my queries history to a text file - or a csv file export giving the fields you currently hold/display

@pawelsalawa
Copy link
Owner Author

Created #4286 for the same.

@tuffnatty
Copy link
Contributor

It would also be really great if one could assign such script to a keyboard shortcut.

@pawelsalawa
Copy link
Owner Author

@audiomuze How do you imagine these "projects"? I mean SQLiteStudio does not have concept of projects.

pawelsalawa added a commit that referenced this issue Aug 12, 2022
…e assistant (hit the assistant hotkey twice).
@pawelsalawa
Copy link
Owner Author

Code Snippets are now implemented for 3.4.0.
To define them, you can use the Code Snippets editor window.
To use them, hit the "code assistant" hotkey twice.
You can define snippet hotkeys, that you can use when the snippets are presented in the code assistant.

@pawelsalawa
Copy link
Owner Author

image

image

@norrye
Copy link

norrye commented Sep 11, 2022

If I terminate sqlitestudio because of a query that I have not optimised or is taking a long time due to a poorly thought out script (i.e. leaving where clauses out...), will I lose the sqleditor windows I have open?

If yes then I guess this is the thought process behind this idea/improvement..

@pawelsalawa
Copy link
Owner Author

@norrye I don't think your question is relevant to this very issue (of SQL scripts collection). Anyway, to answer your concerns - in version 3.4.0 the state of SQLiteStudio (editor windows, etc) is saved on the fly, so if it crashes, you should be able to get your last (or almost last) work state after next start. You should not lose your work.

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

6 participants