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

Make favorite queries execute mycli's special commands #747

Open
statox opened this issue May 29, 2019 · 1 comment
Open

Make favorite queries execute mycli's special commands #747

statox opened this issue May 29, 2019 · 1 comment

Comments

@statox
Copy link

statox commented May 29, 2019

Hi everyone,

I'm not sure if this is a bug or if I'm missing something so I would appreciate some help:

I have a script file that I need to source regularly, using this command it works fine:

source /home/statox/projects/boilerplate/setup.sql

I tried to make it a favorite command with this command:

\fs setupkey source /home/statox/projects/boilerplate/setup.sql

And also by adding this line directly in my .myclirc:

[favorite_queries]
...
setupkey = 'source /home/statox/projects/boilerplate/setup.sql'

In both cases everything is fine (no startup error or anything) until I try to execute the command:

mysql user@localhost:newws> \f setupkey
(1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'source /home/statox/projects/boilerplate/setup.sql' at line 1")

I am sure that my sql script works fine since I can execute it directly and my other favorite commands (which don't use source) all work fine so I don't know how to fix my issue and I didn't found a related issue yet.

Also mycli -v returns Version: 1.8.1

Anyway thank you for your great tool 👍

@tsroten
Copy link
Member

tsroten commented Aug 9, 2019

Hello @statox! I think you're right that the favorite queries don't support client-specific commands (e.g. source). I had started to add this awhile ago, but got sidetracked. Hopefully I can make the time soon to finish this up.

I think this is the only issue that is tracking this, so I'm going to rename it and label it.

Thanks for reporting this!

@tsroten tsroten changed the title Can't source a file with a favorite command Make favorite queries execute mycli's special commands Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants