-
Notifications
You must be signed in to change notification settings - Fork 146
-
Notifications
You must be signed in to change notification settings - Fork 146
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
User configuration file for sqlline #436
Comments
To clarify: when you say 'override the defaults for sqlline parameters globally', you mean set the defaults globally. People could still override this setting, yes? What other systems are you aware of that do this well, and that we should be emulating? For example, ssh has |
Yep, ssh is a great example. The use-case we had here is that SQLLINE-66 caused some grief down in Apache Phoenix. Phoenix does an (incorrect per the JDBC spec) thing around DATE/TIMESTAMP which has caused Phoenix users to expect time components on date columns. SQLLINE-66 had (per JDBC) correctly formatted DATE columns as just "yyyy-MM-dd" whereas Phoenix would have previously returned "yyyy-MM-dd HH:mm:ss". Now, they have a workaround via
However, the reporter (to Istvan and I) of this issue can't get all of their users to change their code to set this first. Thus, if we had a way that could "default" any sqlline session to use these configurations, that would go a long way. |
Yes, I meant "override the built-in defaults", all existing methods to set the parameters should continue to work. |
I was thinking of the way mysql handles my.cnf on Unix, but that's pretty much the same the logic that ssh has. |
I think in this case there are options how
similar thoughts about |
I've created a PR for this issue: #437 |
This change uses the ConnectionConfigParser to load properties created by #386 Simple example for the configuration file:
You can still change the dateFormat later on via the If a property is defined in both sqlline.properties and configuration files, value in configuration file will be used. |
merged at 27bab8f |
Use case:
Being able to override the defaults for sqlline parameters globally
i.e, If I want sqlline to behave like mysql, and not truncate records, I want to have a global way of setting
maxwidth=100000
for all connections, which gets applied anytime I use sqlline.
I think that with SQLLINE-386 and #389 sqlline is actually very close to being able to do that.
One way to implement it would be
The text was updated successfully, but these errors were encountered: