sequeler
sequeler copied to clipboard
Execute Multiple Queries.
Right Now, it only executes the first query and ignores the remaining ones.
I was about to file the same issue :-) I guess the general solution would imply using an SQL parser (there seem to be several written in C and C++ on GitHub), but for a first solution it might be enough with a simple lexer that only understands comments and strings, and then simply splits by semicolon.
I might be able to help a bit but I haven't programmed C (or used lex) in ages and I have never programmed in Vala :-)
Edit: On second thought, what I expect is actually that only the query under the cursor will be executed (ie. what happens in DataGrip, which is great BTW). I guess if there's an active selection all the selected SQL should be sent as a query... that would cover @ar0ra1's usecase.
Thanks both for the report and suggestion. The Gda Library for database queries is not the most intuitive in handling a query string, and as you noticed, it's really basic. Added to the backlog of future updates and features.
Pushing a new version with the fix for this issue later tomorrow!
It still doesn't run the second query!
That's a limitation of the LibGDA that unfortunately I can't fix. I'm working on the new version where I'm gonna drop that library and use specific database bindings. That'll solve it.
Are there any news on this issue? Being able to execute multiple SQL statements in one tab/window would be quite nice.
I'm working on this and it should be out around version 0.6 or similar. I'm trying to keep a sort of organized roadmap of the futures I'm implementing.
ok thanks for letting me know! I am looking forward to this release then.
I still have this problem, but 0.6 has already been released.
create table tab1 (
xxxxxx int
);
drop table tab1;
It's quite an old issue, and I haven't seen the implementation since then. But, Why not build an array of queries? Split the string queries via delimiter (i.e., ";") Add to the queue and execute queries in the series?
@Alecaddd this was for the implementation
Maybe I misunderstood something, this description seemed to match my issue.
Split the string queries via delimiter (i.e., ";")
That's what I am doing.
I put multiple strings with queries in one query, I try to execute it, but only the last query is executed.
Sequeler doesn't currently support running multiple queries at once, I need to work on that feature. You can, for now, put your cursor on the first string, run the query, then move the cursor to the last string and run the query again.
Basically, for now, Sequeler runs the only the string that starts from an empty line or new line, until the end of the document or a semicolon.
I need to work on that feature.
If it is a thing to implement maybe this issue should be reopened? To mark it as a something to be done.
Kind of related to this: it'd be nice if you could run an entire .sql
file from Sequeler.