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 read only version property #146

Closed
snuyanzin opened this issue Sep 12, 2018 · 8 comments
Closed

Add read only version property #146

snuyanzin opened this issue Sep 12, 2018 · 8 comments

Comments

@snuyanzin
Copy link
Collaborator

Sometimes it is more convenient to have !version command than to restart sqlline to see startup message with version and then to reinitialize connections.

@julianhyde
Copy link
Owner

Are you saying that the !version command would re-initialize connections?

Another way to accomplish this is to use the command that displays properties, namely !set with no arguments. version is a read-only property, whereas outputformat is a read-write property.

What are the pros and cons of that approach? Are there any other read-only properties that we might be interested in?

@snuyanzin
Copy link
Collaborator Author

Are you saying that the !version command would re-initialize connections?

No. The only thing it does is printing current version.

About reinitialization I mean that now the only way to know version is restart which leads to reinitialization.

Are there any other read-only properties that we might be interested in?

I could imagine a list of plugged in command handler classes and application class.

What are the pros and cons of that approach?

Well the only cons of properties usage I see is !set provides the output of all existing properties.
However after merging of #143 the problem should gone.

@julianhyde
Copy link
Owner

OK, so it would seem that !set version would be a viable alternative after #143.

What do you think we should do? I am happy with either approach. I just hope we're not on a slippery slope to other commands (say !jdkVersion or !locale or !timezone) in future.

@risdenk
Copy link

risdenk commented Sep 13, 2018

Going to ask the question - does version need to be exposed in an interactive manner?

Assuming sqlline is command line invoked, can't a second shell (ssh, tmux, screen, etc) be opened to check the version of sqlline? If sqlline was upgraded behind the scenes after opening sqlline that would be a weird scenario.

I'm not sure of other command line tools that expose the version after you are already inside them after the initialization. Some don't even print it during the initialization.

@julianhyde
Copy link
Owner

@risdenk
Copy link

risdenk commented Sep 13, 2018

Ah thats a nice example. Thanks

@snuyanzin
Copy link
Collaborator Author

What do you think we should do? I am happy with either approach. I just hope we're not on a slippery slope to other commands (say !jdkVersion or !locale or !timezone) in future.

Agree. It is not good to make such precedents. I do not have strict requirements to have it as !version rather than !set version.
Thank you for the discussion.
I will update the PR with implementation it as !set version and will rename the issue

@snuyanzin snuyanzin changed the title Add !version command Add read only version property Sep 14, 2018
@julianhyde
Copy link
Owner

Fixed in c222391; thanks @snuyanzin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants