Skip to content

Commit

Permalink
[SQLLINE-350] Release 1.9
Browse files Browse the repository at this point in the history
Release notes for sqlline 1.9.0.

Update version in README, README.md and manual.xml.

Add @param in doc description for sqlline.SqlLine#splitCompound

Cosmetic changes.
  • Loading branch information
snuyanzin authored and julianhyde committed Sep 23, 2019
1 parent d44f190 commit 32015c2
Show file tree
Hide file tree
Showing 12 changed files with 127 additions and 57 deletions.
77 changes: 77 additions & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,83 @@

For a full list of releases, see <a href="https://github.com/julianhyde/sqlline/releases">github</a>.

## <a href="https://github.com/julianhyde/sqlline/releases/tag/sqlline-1.9.0">1.9.0</a> (2019-09-22)

There are several improvements regarding user interaction, such as
<a href="https://github.com/julianhyde/sqlline/issues/323">line numbers support</a>,
<a href="https://github.com/julianhyde/sqlline/issues/317">long query
editing which take more than a screen</a>,
and improvements for autocompletion
(<a href="https://github.com/julianhyde/sqlline/issues/331">autocompletion
for schema, table, column names</a>
and <a href="https://github.com/julianhyde/sqlline/issues/314">show
description for completion candidates</a>).

Now there is also
<a href="https://github.com/julianhyde/sqlline/wiki/Demos">demo page</a>
for some sqlline's features

This release requires Java version 8 or higher.

Bugs and functional changes:

* Autocompletion improvements
* [<a href="https://github.com/julianhyde/sqlline/issues/331">SQLLINE-331</a>]
Autocompletion for schema, table, column names
* [<a href="https://github.com/julianhyde/sqlline/issues/314">SQLLINE-314</a>]
Description for command name completion candidates depending on
`showCompletionDesc` property value
* [<a href="https://github.com/julianhyde/sqlline/issues/332">SQLLINE-332</a>]
Add `historyFlags` property to customize `!history` output
* [<a href="https://github.com/julianhyde/sqlline/issues/343">SQLLINE-343</a>]
Use batches accordingly
* [<a href="https://github.com/julianhyde/sqlline/issues/337">SQLLINE-337</a>]
Move connection information to debug level of tracing
* Add `setReadOnly` connection option (iconeb)
* [<a href="https://github.com/julianhyde/sqlline/issues/248">SQLLINE-248</a>]
`!dropall` for specific schemas
* [<a href="https://github.com/julianhyde/sqlline/issues/327">SQLLINE-327</a>]
`!reconnect` should respect `fastconnect` property value
* [<a href="https://github.com/julianhyde/sqlline/issues/321">SQLLINE-321</a>]
Ansiconsole outputformat
* [<a href="https://github.com/julianhyde/sqlline/issues/323">SQLLINE-323</a>]
Add line numbers support
* [<a href="https://github.com/julianhyde/sqlline/issues/306">SQLLINE-306</a>]
Turn off menu because of issue mentioned in #306
* [<a href="https://github.com/julianhyde/sqlline/issues/312">SQLLINE-312</a>]
Show error if there are wrong arguments for `!metadata` methods
* [<a href="https://github.com/julianhyde/sqlline/issues/309">SQLLINE-309</a>]
Fix highlighting of sqlline commands with quoted arguments
* [<a href="https://github.com/julianhyde/sqlline/issues/305">SQLLINE-305</a>]
Posix compatibility for double quotes to allow spaces inside command arguments
* [<a href="https://github.com/julianhyde/sqlline/issues/310">SQLLINE-310</a>]
`!schemas` command
* [<a href="https://github.com/julianhyde/sqlline/issues/318">SQLLINE-318</a>]
Correct highlighting and line continuation for '`/*/`'
* [<a href="https://github.com/julianhyde/sqlline/issues/340">SQLLINE-340</a>]
Rethrow `SQLException` from `DatabaseMetaDataHandler` if it is the cause
* [<a href="https://github.com/julianhyde/sqlline/issues/326">SQLLINE-326</a>]
Respect `user`, `password` properties in url; add `-no-np` option certain
order of arguments while connect

Other:
* [<a href="https://github.com/julianhyde/sqlline/issues/316">SQLLINE-316</a>]
Link to demos page
* [<a href="https://github.com/julianhyde/sqlline/issues/302">SQLLINE-302</a>]
Make tests run with their own `sqlline.properties` via `propertiesFile` property;
remove all instantiations of `SqlLine` from `PromptTest`
* [<a href="https://github.com/julianhyde/sqlline/issues/210">SQLLINE-210</a>]
Add property to skip doc generation
* Upgrades:
* Update JLine3 to 3.12.1
* Update Checkstyle to 8.23
* Update Jmockit to 1.48
* Update Junit to 5.5.1
* Update maven-jar-plugin to 3.1.2
* Update maven-surefire-plugin to 2.22.2
* Update hsqldb up to 2.5.0
* Update h2 up to 1.4.199

## <a href="https://github.com/julianhyde/sqlline/releases/tag/sqlline-1.8.0">1.8.0</a> (2019-05-30)

1.8 comes quite soon after 1.7, and the most significant change is
Expand Down
2 changes: 1 addition & 1 deletion README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SQLLine release 1.8.0
SQLLine release 1.9.0

This is a source or binary distribution of SQLLine.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ If you have [Coursier](https://github.com/coursier/coursier) installed, you
can quickly connect to a [demo Hypersonic database](https://github.com/julianhyde/foodmart-data-hsqldb) with:

```
$ coursier launch sqlline:sqlline:1.8.0 org.hsqldb:hsqldb:2.4.1 net.hydromatic:foodmart-data-hsqldb:0.4 -M sqlline.SqlLine -- -u jdbc:hsqldb:res:foodmart -n FOODMART -p FOODMART -d org.hsqldb.jdbcDriver
$ coursier launch sqlline:sqlline:1.9.0 org.hsqldb:hsqldb:2.5.0 net.hydromatic:foodmart-data-hsqldb:0.4 -M sqlline.SqlLine -- -u jdbc:hsqldb:res:foodmart -n FOODMART -p FOODMART -d org.hsqldb.jdbcDriver
0: jdbc:hsqldb:res:foodmart> select avg("shelf_height" * "shelf_width" * "shelf_depth") as "avg_volume" from "product";
+-------------------------+
| avg_volume |
Expand Down Expand Up @@ -119,7 +119,7 @@ Use the following definition to use `sqlline` in your maven project:
<dependency>
<groupId>sqlline</groupId>
<artifactId>sqlline</artifactId>
<version>1.8.0</version>
<version>1.9.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion src/docbkx/manual.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[
<!-- "http://www.docbook.org/xml/4.2/docbookx.dtd" -->
<!-- "file:/sw/share/xml/dtd/docbookx/4.2.0/docbookx.dtd" -->
<!ENTITY VERSION "1.8.0">
<!ENTITY VERSION "1.9.0">
]>
<book>
<bookinfo>
Expand Down
33 changes: 17 additions & 16 deletions src/main/java/sqlline/SqlCompleter.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,48 +46,49 @@ private static Candidate[] getCompletions(SqlLine sqlLine, boolean skipMeta) {
try {
for (String sqlKeyWord: meta.getSQLKeywords().split(",")) {
final String keyWord = sqlKeyWord.trim();
completions.add(new SqlLineCommandCompleter.SqlLineCandidate(sqlLine,
keyWord, keyWord, null, sqlLine.loc("keyword"), null, null, true));
completions.add(
new SqlLineCommandCompleter.SqlLineCandidate(sqlLine, keyWord,
keyWord, null, sqlLine.loc("keyword"), null, null, true));
}
} catch (Throwable t) {
// ignore
}
try {
for (String numericFunction: meta.getNumericFunctions().split(",")) {
final String function = numericFunction.trim();
completions.add(new SqlLineCommandCompleter.SqlLineCandidate(sqlLine,
function, function, null,
sqlLine.loc("function"), null, null, false));
completions.add(
new SqlLineCommandCompleter.SqlLineCandidate(sqlLine, function,
function, null, sqlLine.loc("function"), null, null, false));
}
} catch (Throwable t) {
// ignore
}
try {
for (String stringFunction: meta.getStringFunctions().split(",")) {
final String function = stringFunction.trim();
completions.add(new SqlLineCommandCompleter.SqlLineCandidate(sqlLine,
function, function, null,
sqlLine.loc("function"), null, null, false));
completions.add(
new SqlLineCommandCompleter.SqlLineCandidate(sqlLine, function,
function, null, sqlLine.loc("function"), null, null, false));
}
} catch (Throwable t) {
// ignore
}
try {
for (String systemFunction: meta.getSystemFunctions().split(",")) {
final String function = systemFunction.trim();
completions.add(new SqlLineCommandCompleter.SqlLineCandidate(sqlLine,
function, function, null,
sqlLine.loc("function"), null, null, false));
completions.add(
new SqlLineCommandCompleter.SqlLineCandidate(sqlLine, function,
function, null, sqlLine.loc("function"), null, null, false));
}
} catch (Throwable t) {
// ignore
}
try {
for (String timeDateFunction: meta.getTimeDateFunctions().split(",")) {
final String function = timeDateFunction.trim();
completions.add(new SqlLineCommandCompleter.SqlLineCandidate(sqlLine,
function, function, null,
sqlLine.loc("function"), null, null, false));
completions.add(
new SqlLineCommandCompleter.SqlLineCandidate(sqlLine, function,
function, null, sqlLine.loc("function"), null, null, false));
}
} catch (Throwable t) {
// ignore
Expand Down Expand Up @@ -122,8 +123,8 @@ private static Candidate[] getCompletions(SqlLine sqlLine, boolean skipMeta) {
}
}
for (String keyWord : Dialect.DEFAULT_KEYWORD_SET) {
completions.add(generateCandidate(
keyWord, keyWord, sqlLine, "keyword", true));
completions.add(
generateCandidate(keyWord, keyWord, sqlLine, "keyword", true));
}
// set the Strings that will be completed
return completions.toArray(new Candidate[0]);
Expand Down
1 change: 1 addition & 0 deletions src/main/java/sqlline/SqlLine.java
Original file line number Diff line number Diff line change
Expand Up @@ -1048,6 +1048,7 @@ String[] split(String line, int limit) {
* <blockquote>{ {"!tables"}, {"My Schema", "My Table"} }</blockquote>
*
* @param line the line to break up
* @param keepSqlIdentifierQuotes keep SQL identifiers
* @return an array of compound words
*/
public String[][] splitCompound(
Expand Down
20 changes: 11 additions & 9 deletions src/main/java/sqlline/SqlLineCommandCompleter.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,17 @@ class SqlLineCommandCompleter extends AggregateCompleter {
final String commandName = SqlLine.COMMAND_PREFIX + cmd;
final String helpText = commandHandler.getHelpText();
final int firstEndOfLineIndex = helpText.indexOf('\n');
compl.add(new StringsCompleter(
new SqlLineCandidate(
sqlLine, AttributedString.stripAnsi(commandName),
commandName, sqlLine.loc("command-name"),
firstEndOfLineIndex == -1
? helpText : helpText.substring(0, firstEndOfLineIndex),
// there could be whatever else instead helpText
// which is the same for commands with all theirs aliases
null, helpText, true)));
compl.add(
new StringsCompleter(
new SqlLineCandidate(sqlLine,
AttributedString.stripAnsi(commandName), commandName,
sqlLine.loc("command-name"),
firstEndOfLineIndex == -1
? helpText
: helpText.substring(0, firstEndOfLineIndex),
// there could be whatever else instead helpText
// which is the same for commands with all theirs aliases
null, helpText, true)));
compl.addAll(parameterCompleters);
compl.add(new NullCompleter()); // last param no complete
completers.add(new ArgumentCompleter(compl));
Expand Down
7 changes: 4 additions & 3 deletions src/main/java/sqlline/SqlLineOpts.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,10 @@ public List<Completer> setOptionCompleters(
Map<String, Completer> comp = new HashMap<>();
final String start = "START";
comp.put(start,
new StringsCompleter(new SqlLineCommandCompleter.SqlLineCandidate(
sqlLine, "!set", "!set", sqlLine.loc("command-name"),
sqlLine.loc("help-set"), null, "!set", true)));
new StringsCompleter(
new SqlLineCommandCompleter.SqlLineCandidate(sqlLine, "!set",
"!set", sqlLine.loc("command-name"), sqlLine.loc("help-set"),
null, "!set", true)));
Collection<BuiltInProperty> booleanProperties = new ArrayList<>();
Collection<BuiltInProperty> withDefinedAvailableValues = new ArrayList<>();
StringBuilder sb = new StringBuilder(start + " (");
Expand Down
5 changes: 2 additions & 3 deletions src/test/java/org/hsqldb/jdbc/CustomDatabaseMetadata.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ public CustomDatabaseMetadata(JDBCConnection c) throws SQLException {
super(c);
}

@Override
public ResultSet getPrimaryKeys(
String catalog, String schema, String table) throws SQLException {
@Override public ResultSet getPrimaryKeys(String catalog, String schema,
String table) throws SQLException {
throw new SQLException("SQL Exception");
}
}
Expand Down
1 change: 0 additions & 1 deletion src/test/java/sqlline/BufferedRowsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@

import static org.junit.jupiter.params.provider.Arguments.of;


/**
* Test cases for BufferedRows.
*/
Expand Down
28 changes: 10 additions & 18 deletions src/test/java/sqlline/CompletionTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,7 @@ private static Stream<Arguments> propertyCompletionProvider() {
of("!set outputFormat js", "!set outputFormat json"),
of("!set outputFormat xmlel", "!set outputFormat xmlelements"),
of("!set colorScheme che", "!set colorScheme chester"),
of("!set colorScheme sol", "!set colorScheme solarized")
);
of("!set colorScheme sol", "!set colorScheme solarized"));
}

@ParameterizedTest
Expand Down Expand Up @@ -206,8 +205,7 @@ private static Stream<Arguments> sqlKeywordCompletionProvider() {
of("FR", "FROM"),
of("fr", "from"),
of("wher", "where"),
of("betwe", "between")
);
of("betwe", "between"));
}

@ParameterizedTest
Expand All @@ -228,8 +226,8 @@ private static Stream<Arguments> schemaTableColumnProvider() {
of("\"SCHEMA WITH SPACES\".TABLE.COL",
Arrays.asList("\"SCHEMA WITH SPACES\"", "TABLE", "COL")),
// wrong scenario
of("SCHEMA WITH SPACES.TABLE.COL", Collections.singletonList("SCHEMA"))
);
of("SCHEMA WITH SPACES.TABLE.COL",
Collections.singletonList("SCHEMA")));
}

@ParameterizedTest
Expand Down Expand Up @@ -263,8 +261,7 @@ private static Stream<Arguments> dialectSpecificNameProvider() {
of("SCHEMA", storesUpperDialect, "SCHEMA"),
of("SCHEMA", storesUpperDialect, "[SCHEMA]"),
of("ScHeMa", storesUpperDialect, "[ScHeMa]"),
of("", storesUpperDialect, "[]")
);
of("", storesUpperDialect, "[]"));
}

@ParameterizedTest
Expand Down Expand Up @@ -299,8 +296,7 @@ private static Stream<Arguments> nameProvider() {
of("SCHEMA", dialectUp, false, "SCHEMA"),
of("[SCHEMA]", dialectUp, true, "SCHEMA"),
of("[ScHeMA]", dialectUp, true, "ScHeMA"),
of("[]", dialectUp, true, "")
);
of("[]", dialectUp, true, ""));
}

@ParameterizedTest
Expand Down Expand Up @@ -370,8 +366,7 @@ private static Stream<Arguments> stringsForSchemaTableColumnCompletions() {
of("\"TEST SCHEMA WITH SPACES\".\"TABLE WITH SPACES\".PK",
"\"TEST SCHEMA WITH SPACES\".\"TABLE WITH SPACES\".P"),
of("\"TEST SCHEMA WITH SPACES\".\"TABLE WITH SPACES\".\"with spaces\"",
"\"TEST SCHEMA WITH SPACES\".\"TABLE WITH SPACES\".\"w")
);
"\"TEST SCHEMA WITH SPACES\".\"TABLE WITH SPACES\".\"w"));
}

@ParameterizedTest
Expand Down Expand Up @@ -448,8 +443,7 @@ public void testSchemaTableColumnCompletionsForMySqlDialect(
of("`TEST SCHEMA WITH SPACES`.`TABLE WITH SPACES`.PK",
"`TEST SCHEMA WITH SPACES`.`TABLE WITH SPACES`.P"),
of("`TEST SCHEMA WITH SPACES`.`TABLE WITH SPACES`.`with spaces`",
"`TEST SCHEMA WITH SPACES`.`TABLE WITH SPACES`.`w")
);
"`TEST SCHEMA WITH SPACES`.`TABLE WITH SPACES`.`w"));
}

@ParameterizedTest
Expand Down Expand Up @@ -526,8 +520,7 @@ public void testSchemaTableColumnCompletionsForSquareBracketsDialect(
of("[TEST SCHEMA WITH SPACES].[TABLE WITH SPACES].PK",
"[TEST SCHEMA WITH SPACES].[TABLE WITH SPACES].P"),
of("[TEST SCHEMA WITH SPACES].[TABLE WITH SPACES].[with spaces]",
"[TEST SCHEMA WITH SPACES].[TABLE WITH SPACES].[w")
);
"[TEST SCHEMA WITH SPACES].[TABLE WITH SPACES].[w"));
}

@ParameterizedTest
Expand Down Expand Up @@ -557,8 +550,7 @@ public void testNoSchemaSqlCompletionsWithFastConnect(
private static Stream<Arguments> noSchemaSqlCompletionsWithFastConnect() {
return Stream.of(
of("TEST_SCHEMA_FIRST", "TEST_SCHEMA_F"),
of("TABLE_FIRST", "TABLE_F")
);
of("TABLE_FIRST", "TABLE_F"));
}

private LineReaderCompletionImpl getDummyLineReader() {
Expand Down
4 changes: 1 addition & 3 deletions src/test/java/sqlline/SqlLineArgsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -818,9 +818,7 @@ public void testRecordFilenameWithSpace() {
containsString("8/8 values 3;\n"),
containsString("'C1'\n"),
containsString("'3'\n"),
containsString("1 row selected (")
)
);
containsString("1 row selected (")));


// Now check that the right stuff got into the file.
Expand Down

0 comments on commit 32015c2

Please sign in to comment.