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

option to execute only "current" query #11

Closed
qwesda opened this Issue Jun 19, 2015 · 22 comments

Comments

Projects
None yet
3 participants
@qwesda

qwesda commented Jun 19, 2015

The way sequel pro only ran the "current" query (the query that had the keyboard curser) always made a lot of sense to me.

I sometimes want to execute multiple queries at once, but usually I'm editing and re-executing the same query multiple times. If I have auxiliary queries I either have to keep them in a separate window or comment them out.

cmd + enter to execute the "current" query or selection and cmd + option + enter to execute all queries would be great.

@jakob jakob added the enhancement label Jun 19, 2015

@danillos

This comment has been minimized.

Show comment
Hide comment
@danillos

danillos Jul 8, 2015

The Sequel Pro separate the queries by ; when the pointer is over the query, it shows the query highlighted, and on hit cmd + r only run this current query.

I really like this approach.

screen shot 2015-07-08 at 8 28 11 pm

danillos commented Jul 8, 2015

The Sequel Pro separate the queries by ; when the pointer is over the query, it shows the query highlighted, and on hit cmd + r only run this current query.

I really like this approach.

screen shot 2015-07-08 at 8 28 11 pm

@jakob

This comment has been minimized.

Show comment
Hide comment
@jakob

jakob Aug 17, 2015

Owner

I started to work on this. Try the latest build: Postico 2015-08-17

In this build, Postico executes only the current statement. You can highlight multiple statements to execute more than one. However, after implementing this, I found out that I will need to completely rewrite the way the query history works; it makes no sense the way it is now (replacing the full text field doesn't make sense when you have many queries in the text field)

Owner

jakob commented Aug 17, 2015

I started to work on this. Try the latest build: Postico 2015-08-17

In this build, Postico executes only the current statement. You can highlight multiple statements to execute more than one. However, after implementing this, I found out that I will need to completely rewrite the way the query history works; it makes no sense the way it is now (replacing the full text field doesn't make sense when you have many queries in the text field)

@danillos

This comment has been minimized.

Show comment
Hide comment
@danillos

danillos Aug 17, 2015

Thanks @jakob, this is awesome.

I'm testing here, so far everything is fine, I'll test it more along this week.

I noticed that when I hit Enter between two queries has a blink in the queries with the highlight.

About the Query History, removing the other query sometimes is annoying, because sometimes We create a group of queries to do the work more easily, and now we can't back to this group using the query history, because it shows only the last one executed. But I understand your point of view too.

thanks @jakob

danillos commented Aug 17, 2015

Thanks @jakob, this is awesome.

I'm testing here, so far everything is fine, I'll test it more along this week.

I noticed that when I hit Enter between two queries has a blink in the queries with the highlight.

About the Query History, removing the other query sometimes is annoying, because sometimes We create a group of queries to do the work more easily, and now we can't back to this group using the query history, because it shows only the last one executed. But I understand your point of view too.

thanks @jakob

@qwesda

This comment has been minimized.

Show comment
Hide comment
@qwesda

qwesda Aug 17, 2015

Great that this feature is coming!

I also noticed some minor issues on the "edges" of queries:

  • any cursor position should activate/select a query – unless there are no queries in the editor
  • I think a good logic would be that a query includes a semicolon plus /[ \t]*\n?/ – everything after this regex belongs to the next query
  • a special case would be a -- comment, which should still belong to the previous query unless they are separated by a linebreak
  • anything before the first query belongs to the first query and anything after the last query belongs to the last query

the execute button should be visually disabled if no query is activated/selected

qwesda commented Aug 17, 2015

Great that this feature is coming!

I also noticed some minor issues on the "edges" of queries:

  • any cursor position should activate/select a query – unless there are no queries in the editor
  • I think a good logic would be that a query includes a semicolon plus /[ \t]*\n?/ – everything after this regex belongs to the next query
  • a special case would be a -- comment, which should still belong to the previous query unless they are separated by a linebreak
  • anything before the first query belongs to the first query and anything after the last query belongs to the last query

the execute button should be visually disabled if no query is activated/selected

@jakob

This comment has been minimized.

Show comment
Hide comment
@jakob

jakob Aug 17, 2015

Owner

@qwesda I'm not sure that a query should always be active. If the insertion point is between two queries, I think it's better to make no query active.

The execute button should be visually disabled, but I just realised that the button doesn't look deactivated on Yosemite. Damn Apple for changing button styles every year.

Comments like below should belong to the query, that's a good point.

select 1; -- select one
Owner

jakob commented Aug 17, 2015

@qwesda I'm not sure that a query should always be active. If the insertion point is between two queries, I think it's better to make no query active.

The execute button should be visually disabled, but I just realised that the button doesn't look deactivated on Yosemite. Damn Apple for changing button styles every year.

Comments like below should belong to the query, that's a good point.

select 1; -- select one
@danillos

This comment has been minimized.

Show comment
Hide comment
@danillos

danillos Aug 21, 2015

Hi @jakob,

When the pointer is in the beginningor end of the row, the query is not highlighted.

screen shot 2015-08-21 at 4 41 43 pm

screen shot 2015-08-21 at 4 37 40 pm

danillos commented Aug 21, 2015

Hi @jakob,

When the pointer is in the beginningor end of the row, the query is not highlighted.

screen shot 2015-08-21 at 4 41 43 pm

screen shot 2015-08-21 at 4 37 40 pm

@jakob

This comment has been minimized.

Show comment
Hide comment
@jakob

jakob Sep 10, 2015

Owner

Hi @qwesda and @danillos, I've now improved the query detection code. I've implemented most of your suggestions and fixed the problem when the cursor is at the end of the row. Would you be interested in testing it?

Here's the latest build:
https://eggerapps-downloads.s3.amazonaws.com/postico-2015-09-10.zip

Owner

jakob commented Sep 10, 2015

Hi @qwesda and @danillos, I've now improved the query detection code. I've implemented most of your suggestions and fixed the problem when the cursor is at the end of the row. Would you be interested in testing it?

Here's the latest build:
https://eggerapps-downloads.s3.amazonaws.com/postico-2015-09-10.zip

@danillos

This comment has been minimized.

Show comment
Hide comment
@danillos

danillos Sep 10, 2015

Nice Jakob, I’m testing it right now.

On Sep 10, 2015, at 12:19 PM, Jakob Egger notifications@github.com wrote:

Hi @qwesda https://github.com/qwesda and @danillos https://github.com/danillos, I've now improved the query detection code. I've implemented most of your suggestions and fixed the problem when the cursor is at the end of the row. Would you be interested in testing it?

Here's the latest build:
http://eggerapps-downloads.s3.amazonaws.com/postico-2015-09-10.zip http://eggerapps-downloads.s3.amazonaws.com/postico-2015-09-10.zip

Reply to this email directly or view it on GitHub #11 (comment).

danillos commented Sep 10, 2015

Nice Jakob, I’m testing it right now.

On Sep 10, 2015, at 12:19 PM, Jakob Egger notifications@github.com wrote:

Hi @qwesda https://github.com/qwesda and @danillos https://github.com/danillos, I've now improved the query detection code. I've implemented most of your suggestions and fixed the problem when the cursor is at the end of the row. Would you be interested in testing it?

Here's the latest build:
http://eggerapps-downloads.s3.amazonaws.com/postico-2015-09-10.zip http://eggerapps-downloads.s3.amazonaws.com/postico-2015-09-10.zip

Reply to this email directly or view it on GitHub #11 (comment).

@danillos

This comment has been minimized.

Show comment
Hide comment
@danillos

danillos Sep 10, 2015

Hi @jakob, I found this issue http://quick.as/7bghge28

Sorry about the music =/

danillos commented Sep 10, 2015

Hi @jakob, I found this issue http://quick.as/7bghge28

Sorry about the music =/

@danillos

This comment has been minimized.

Show comment
Hide comment
@danillos

danillos commented Sep 10, 2015

Hi @jakob, I found more one issue http://quick.as/6ngcqa5v

@jakob

This comment has been minimized.

Show comment
Hide comment
@jakob

jakob Sep 11, 2015

Owner

Thanks for the quick feedback. I fixed the first issue:
https://eggerapps-downloads.s3.amazonaws.com/postico-2015-09-11.zip

I'm not sure what the problem is with the second video. Could you explain the problem in more detail?

Owner

jakob commented Sep 11, 2015

Thanks for the quick feedback. I fixed the first issue:
https://eggerapps-downloads.s3.amazonaws.com/postico-2015-09-11.zip

I'm not sure what the problem is with the second video. Could you explain the problem in more detail?

@danillos

This comment has been minimized.

Show comment
Hide comment
@danillos

danillos Sep 11, 2015

When I press cmd + / the query is commented, but when a press again, it don't uncomment the query.

Only happens with multiple lines comments.

In the public build is works fine, but with that build don't.

On Sep 11, 2015, 04:13 -0300, Jakob Eggernotifications@github.com, wrote:

Thanks for the quick feedback. I fixed the first issue:
http://eggerapps-downloads.s3.amazonaws.com/postico-2015-09-11.zip

I'm not sure what the problem is with the second video. Could you explain the problem in more detail?


Reply to this email directly orview it on GitHub(#11 (comment)).

danillos commented Sep 11, 2015

When I press cmd + / the query is commented, but when a press again, it don't uncomment the query.

Only happens with multiple lines comments.

In the public build is works fine, but with that build don't.

On Sep 11, 2015, 04:13 -0300, Jakob Eggernotifications@github.com, wrote:

Thanks for the quick feedback. I fixed the first issue:
http://eggerapps-downloads.s3.amazonaws.com/postico-2015-09-11.zip

I'm not sure what the problem is with the second video. Could you explain the problem in more detail?


Reply to this email directly orview it on GitHub(#11 (comment)).

@qwesda

This comment has been minimized.

Show comment
Hide comment
@qwesda

qwesda Sep 14, 2015

For me everything works as expected.
The only minor thing would be that trailing whitespace after the last query should belong to the last query – analog to all whitespace before to the first query (which is already handeled).

Anyway, great job! this made postico a lot more useful to me!

qwesda commented Sep 14, 2015

For me everything works as expected.
The only minor thing would be that trailing whitespace after the last query should belong to the last query – analog to all whitespace before to the first query (which is already handeled).

Anyway, great job! this made postico a lot more useful to me!

@qwesda

This comment has been minimized.

Show comment
Hide comment
@qwesda

qwesda Sep 14, 2015

Maybe you could add cmd + alt + <return> as execute all queries
cmd A + cmd <return> does of course the same, but it also resets the cursor position

qwesda commented Sep 14, 2015

Maybe you could add cmd + alt + <return> as execute all queries
cmd A + cmd <return> does of course the same, but it also resets the cursor position

@qwesda

This comment has been minimized.

Show comment
Hide comment
@qwesda

qwesda Sep 17, 2015

I also have the same issue as @danillos cmd + / only increases the comment level, but uncommenting doesn't work.

I also found that execute selection is no longer working.

qwesda commented Sep 17, 2015

I also have the same issue as @danillos cmd + / only increases the comment level, but uncommenting doesn't work.

I also found that execute selection is no longer working.

@jakob

This comment has been minimized.

Show comment
Hide comment
@jakob

jakob Oct 8, 2015

Owner

I've now fixed the commenting issue in version 0.27. Execute selection also works again now. You can read about all the other new things in the changelist:
https://eggerapps.at/postico/changelist.html

I've decided to disable the execute button when the cursor is on a blank line that doesn't belong to a statement. I tried making it so that it executes the nearest statement, but I couldn't find a good rule which one is the nearest statement (should it be the statement above or below?). Everything I tried seemed confusing in some circumstances.

Owner

jakob commented Oct 8, 2015

I've now fixed the commenting issue in version 0.27. Execute selection also works again now. You can read about all the other new things in the changelist:
https://eggerapps.at/postico/changelist.html

I've decided to disable the execute button when the cursor is on a blank line that doesn't belong to a statement. I tried making it so that it executes the nearest statement, but I couldn't find a good rule which one is the nearest statement (should it be the statement above or below?). Everything I tried seemed confusing in some circumstances.

@jakob jakob closed this Oct 8, 2015

@qwesda

This comment has been minimized.

Show comment
Hide comment
@qwesda

qwesda Oct 8, 2015

Hitting CMD + A in the query editor disables the execute button and there is no CMD + OPTION + <ENTER> to execute all queries.

qwesda commented Oct 8, 2015

Hitting CMD + A in the query editor disables the execute button and there is no CMD + OPTION + <ENTER> to execute all queries.

@qwesda

This comment has been minimized.

Show comment
Hide comment
@qwesda

qwesda Oct 8, 2015

the issue from @danillos that hitting CMD + / repeatedly only increases the comment level is also still present

qwesda commented Oct 8, 2015

the issue from @danillos that hitting CMD + / repeatedly only increases the comment level is also still present

@jakob

This comment has been minimized.

Show comment
Hide comment
@jakob

jakob Oct 8, 2015

Owner

@qwesda Jesus, you are right; it seems a last minute change broke the query again. I'll get to work on those immediately.

Owner

jakob commented Oct 8, 2015

@qwesda Jesus, you are right; it seems a last minute change broke the query again. I'll get to work on those immediately.

@jakob jakob reopened this Oct 8, 2015

@jakob

This comment has been minimized.

Show comment
Hide comment
@jakob

jakob Oct 8, 2015

Owner

@qwesda Could you try if this build works: Postico 0.28

Owner

jakob commented Oct 8, 2015

@qwesda Could you try if this build works: Postico 0.28

@qwesda

This comment has been minimized.

Show comment
Hide comment
@qwesda

qwesda Oct 8, 2015

  • CMD + A is working
  • CMD + / is working
  • CMD + OPTION + <ENTER> is still missing

qwesda commented Oct 8, 2015

  • CMD + A is working
  • CMD + / is working
  • CMD + OPTION + <ENTER> is still missing
@jakob

This comment has been minimized.

Show comment
Hide comment
@jakob

jakob Oct 9, 2015

Owner

Just released 0.28. The final version also adds support for Cmd-Option-Enter to execute all queries.
Details & Download link: https://eggerapps.at/postico/changelist.html

Owner

jakob commented Oct 9, 2015

Just released 0.28. The final version also adds support for Cmd-Option-Enter to execute all queries.
Details & Download link: https://eggerapps.at/postico/changelist.html

@jakob jakob closed this Oct 9, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment