You can subscribe to this list here.
2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(8) |
Oct
(34) |
Nov
(7) |
Dec
(2) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(29) |
Feb
(10) |
Mar
(14) |
Apr
(4) |
May
(2) |
Jun
|
Jul
(14) |
Aug
(25) |
Sep
(6) |
Oct
(18) |
Nov
(4) |
Dec
(14) |
2009 |
Jan
(28) |
Feb
(15) |
Mar
(15) |
Apr
(8) |
May
|
Jun
|
Jul
(1) |
Aug
(4) |
Sep
(12) |
Oct
(1) |
Nov
|
Dec
(22) |
2010 |
Jan
(14) |
Feb
|
Mar
(2) |
Apr
|
May
(7) |
Jun
|
Jul
(3) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
From: SVN by r. <sv...@ca...> - 2007-10-08 15:43:13
|
Author: rotman Date: 2007-10-08 17:43:13 +0200 (Mon, 08 Oct 2007) New Revision: 175 Modified: src/main/java/nl/improved/sqlclient/SQLShell.java Log: Use InputCommand for batch executions Modified: src/main/java/nl/improved/sqlclient/SQLShell.java =================================================================== --- src/main/java/nl/improved/sqlclient/SQLShell.java 2007-10-08 15:31:56 UTC (rev 174) +++ src/main/java/nl/improved/sqlclient/SQLShell.java 2007-10-08 15:43:13 UTC (rev 175) @@ -1042,20 +1042,8 @@ cmd.append(line); if (line.endsWith(";")) { // Exec cmd - final StringBuilder cmdStringBuilder = cmd; - executeCommand(new SQLCommand() { - public String getUntrimmedCommandString() { - return cmdStringBuilder.toString(); - } - public List<StringBuilder> getEditableLines() { - return Arrays.asList(new StringBuilder[]{cmdStringBuilder}); - } - public List<? extends CharSequence> getLines() { - return Arrays.asList(new StringBuilder[]{cmdStringBuilder}); - } - - }); - cmd = new StringBuilder(); + executeCommand(new InputCommand(cmd)); + cmd=new StringBuilder(); } } } catch(IOException e) { @@ -1091,6 +1079,10 @@ this.command = new StringBuilder(command); } + public InputCommand(StringBuilder command) { + this.command = command; + } + @Override public String getUntrimmedCommandString() { return command.toString(); |
From: SVN by r. <sv...@ca...> - 2007-10-08 15:31:53
|
Author: rotman Date: 2007-10-08 17:31:56 +0200 (Mon, 08 Oct 2007) New Revision: 174 Modified: ChangeLog Log: implemented direct connect Modified: ChangeLog =================================================================== --- ChangeLog 2007-10-08 15:31:38 UTC (rev 173) +++ ChangeLog 2007-10-08 15:31:56 UTC (rev 174) @@ -7,6 +7,7 @@ * Quit with ^D (on empty commandline) * Added tab completion for DESC command * BUGFIX: fix tab completion when a "keyword" was found as part of a name. + * Added possiblity to start SQLShell in a connected state by providing the connectionstring as commandline argument 0.2 (17-09-2007) * Search in history (for example by entering '/query' to make the current command the last command with query in it) |
From: SVN by r. <sv...@ca...> - 2007-10-08 15:31:36
|
Author: rotman Date: 2007-10-08 17:31:38 +0200 (Mon, 08 Oct 2007) New Revision: 173 Modified: README Log: Implemented a feature request Modified: README =================================================================== --- README 2007-10-08 15:29:40 UTC (rev 172) +++ README 2007-10-08 15:31:38 UTC (rev 173) @@ -29,7 +29,6 @@ - Highlight the commands to make a distinction between the output and the commands - Remember commands over sessions - Make it possible to export/import data via xml (I think there is even an xml standard for this) -- Make it possible to open a connection using command line parameters instead of typing 'connect' - Add config possibility to config: -- command history size -- screen history size |
From: SVN by r. <sv...@ca...> - 2007-10-08 15:29:39
|
Author: rotman Date: 2007-10-08 17:29:40 +0200 (Mon, 08 Oct 2007) New Revision: 172 Modified: src/main/java/nl/improved/sqlclient/SQLShell.java Log: Implement commandline connect Modified: src/main/java/nl/improved/sqlclient/SQLShell.java =================================================================== --- src/main/java/nl/improved/sqlclient/SQLShell.java 2007-10-08 15:18:39 UTC (rev 171) +++ src/main/java/nl/improved/sqlclient/SQLShell.java 2007-10-08 15:29:40 UTC (rev 172) @@ -25,7 +25,6 @@ import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; -import javax.sound.midi.SysexMessage; import jcurses.widgets.Window; import jcurses.system.InputChar; import jcurses.system.Toolkit; @@ -281,7 +280,7 @@ debug("Unknown character: "+ inp.getCode()); } else if (inp.toString().equals("")) { //Ctrl+D if (commandLines.getCommandString().length() == 0) { //Quit on empty commandline, ignore otherwise - new QuitCommand().execute(new SQLCommand()); + executeCommand(new InputCommand("quit")); } } else { if (inp.getCharacter() == '\n') { @@ -1077,8 +1076,42 @@ "Note that all statements must be terminated with ';' (sql statements as well as connect statements or spool)"; } } + + /** + * Command class to execute a 'custom command'. + * this makes it possible to have 'automated' commands executed. + * E.g.: + * executeCommand(new InputCommand("connect")); + * will eventually execute the Connect command. + */ + private static class InputCommand extends SQLCommand { + private StringBuilder command; + + public InputCommand(String command) { + this.command = new StringBuilder(command); + } + + @Override + public String getUntrimmedCommandString() { + return command.toString(); + } + @Override + public List<StringBuilder> getEditableLines() { + return Arrays.asList(new StringBuilder[]{command}); + } + @Override + public List<? extends CharSequence> getLines() { + return Arrays.asList(new StringBuilder[]{command}); + } + } + public static void main(String[] args) { SQLShell shell = new SQLShell(); shell.show(); + + //Interpret first argument as a connect argument + if (args.length > 0) { + shell.executeCommand(new InputCommand("connect "+args[0])); + } } } |
From: SVN by r. <sv...@ca...> - 2007-10-08 15:18:40
|
Author: rotman Date: 2007-10-08 17:18:39 +0200 (Mon, 08 Oct 2007) New Revision: 171 Modified: sqlshell Log: Allow commandline argument and pass that as connection string Modified: sqlshell =================================================================== --- sqlshell 2007-10-08 14:39:14 UTC (rev 170) +++ sqlshell 2007-10-08 15:18:39 UTC (rev 171) @@ -39,4 +39,4 @@ CP=${CP}:${DRIVER} done -${JAVA} -cp ${CP} nl.improved.sqlclient.SQLShell +${JAVA} -cp ${CP} nl.improved.sqlclient.SQLShell $@ |
From: SVN by r. <sv...@ca...> - 2007-10-08 14:39:13
|
Author: rotman Date: 2007-10-08 16:39:14 +0200 (Mon, 08 Oct 2007) New Revision: 170 Modified: makejars.sh Log: include ChangeLog in release archives Modified: makejars.sh =================================================================== --- makejars.sh 2007-10-08 14:34:39 UTC (rev 169) +++ makejars.sh 2007-10-08 14:39:14 UTC (rev 170) @@ -12,6 +12,7 @@ cp -Rf ../src source cp ../pom.xml source cp ../README source +cp ../ChangeLog source cp ../${PROJECT} source cd source rm -Rf src/www @@ -28,6 +29,7 @@ mkdir bin cp ../${PROJECT} bin cp ../README bin +cp ../ChangeLog bin cp ../src/main/resources/db.properties bin cp ../target/*.jar bin/${PROJECT}.jar cp -Rf ../lib bin |
From: SVN by r. <sv...@ca...> - 2007-10-08 14:34:37
|
Author: rotman Date: 2007-10-08 16:34:39 +0200 (Mon, 08 Oct 2007) New Revision: 169 Modified: makejars.sh sqlshell Log: Make sure that the 'bin' jar has a script that let's a user run and connect without having to modify the script Modified: makejars.sh =================================================================== --- makejars.sh 2007-10-08 14:12:12 UTC (rev 168) +++ makejars.sh 2007-10-08 14:34:39 UTC (rev 169) @@ -38,7 +38,7 @@ cd bin find . -name "*.svn" | xargs rm -Rf mv sqlshell _sqlshell -cat _sqlshell | awk '{ gsub("SQLSHELL=","#SQLSHELL="); gsub("##SQLSHELL=","SQLSHELL="); print }' > sqlshell +cat _sqlshell | awk '{ gsub("SQLSHELL=target/classes","#SQLSHELL=target/classes"); gsub("#SQLSHELL=\${WORKINGDIR}:\${WORKINGDIR}/sqlshell.jar","SQLSHELL=${WORKINGDIR}:${WORKINGDIR}/sqlshell.jar"); print }' > sqlshell chmod +x sqlshell rm _sqlshell tar zcf ../${PROJECT}-bin-${VERSION}.tgz . Modified: sqlshell =================================================================== --- sqlshell 2007-10-08 14:12:12 UTC (rev 168) +++ sqlshell 2007-10-08 14:34:39 UTC (rev 169) @@ -27,7 +27,7 @@ JCURSES=${WORKINGDIR}/lib # Where to find the SQLShell classes -#SQLSHELL=${WORKINGDIR}/sqlshell.jar +#SQLSHELL=${WORKINGDIR}:${WORKINGDIR}/sqlshell.jar SQLSHELL=target/classes # Jars providing drivers for the databases to support. |
From: SVN by r. <sv...@ca...> - 2007-10-08 14:12:10
|
Author: rotman Date: 2007-10-08 16:12:12 +0200 (Mon, 08 Oct 2007) New Revision: 168 Modified: / Log: Ignore target dir Property changes on: ___________________________________________________________________ Name: svn:ignore + target |
From: SVN by r. <sv...@ca...> - 2007-10-08 13:47:16
|
Author: rotman Date: 2007-10-08 15:46:58 +0200 (Mon, 08 Oct 2007) New Revision: 167 Modified: makejars.sh sqlshell Log: Use sane defaults Modified: makejars.sh =================================================================== --- makejars.sh 2007-10-08 12:16:13 UTC (rev 166) +++ makejars.sh 2007-10-08 13:46:58 UTC (rev 167) @@ -1,18 +1,23 @@ #!/bin/bash +PROJECT=sqlshell VERSION=0.2 + +#cleanup rm -Rf release mkdir release cd release + #create source files mkdir source cp -Rf ../src source cp ../pom.xml source cp ../README source -cp ../sqlshell source +cp ../${PROJECT} source cd source -rm -Rf `find . -name *.svn` -tar zcf ../sqlshell-src-$VERSION.tgz . -zip -r ../sqlshell-src-$VERSION.zip . +rm -Rf src/www +find . -name "*.svn" | xargs rm -Rf +tar zcf ../${PROJECT}-src-${VERSION}.tgz . +zip -r ../${PROJECT}-src-${VERSION}.zip . cd .. rm -Rf source @@ -21,19 +26,23 @@ mvn clean package cd release mkdir bin -cp ../sqlshell bin +cp ../${PROJECT} bin cp ../README bin cp ../src/main/resources/db.properties bin -cp ../target/*.jar bin/sqlclient.jar +cp ../target/*.jar bin/${PROJECT}.jar cp -Rf ../lib bin cp -Rf ${HOME}/.m2/repository/hsqldb/hsqldb/1.8.0/hsqldb-1.8.0.jar bin/lib mkdir bin/db cp -Rf ../db/*.script bin/db cp -Rf ../db/*.properties bin/db cd bin -rm -Rf `find . -name *.svn` -tar zcf ../sqlshell-bin-$VERSION.tgz . -zip -r ../sqlshell-bin-$VERSION.zip . +find . -name "*.svn" | xargs rm -Rf +mv sqlshell _sqlshell +cat _sqlshell | awk '{ gsub("SQLSHELL=","#SQLSHELL="); gsub("##SQLSHELL=","SQLSHELL="); print }' > sqlshell +chmod +x sqlshell +rm _sqlshell +tar zcf ../${PROJECT}-bin-${VERSION}.tgz . +zip -r ../${PROJECT}-bin-${VERSION}.zip . cd .. rm -Rf bin cd .. Modified: sqlshell =================================================================== --- sqlshell 2007-10-08 12:16:13 UTC (rev 166) +++ sqlshell 2007-10-08 13:46:58 UTC (rev 167) @@ -15,28 +15,22 @@ # limitations under the License. # Path to java executable +#JAVA=$(which java) JAVA=${JAVA_HOME}/bin/java -#JAVA=`which java` # Dir to use as base for relative locations -#WORKINGDIR=`pwd` -WORKINGDIR=`pwd` +WORKINGDIR=$(pwd) # The directory where the JCurses jar and library are located. # Please note that JCurses requires tje jcurses.jar and libjcurses.so to # be located in the same directory. -#JCURSES=${WORKINGDIR}/lib/ JCURSES=${WORKINGDIR}/lib # Where to find the SQLShell classes -#SQLSHELL=${WORKINGDIR}/sqlclient-0.1-SNAPSHOT.jar -#SQLSHELL=target/classes -SQLSHELL=sqlclient.jar +#SQLSHELL=${WORKINGDIR}/sqlshell.jar +SQLSHELL=target/classes # Jars providing drivers for the databases to support. -#DRIVERS="${HOME}/.m2/repository/hsqldb/hsqldb/1.8.0/hsqldb-1.8.0.jar -#${HOME}/.m2/repository/db/oracle/1.4/oracle-1.4.jar" - DRIVERS="${WORKINGDIR}/lib/hsqldb-1.8.0.jar" # The classpath to use when running |
From: SVN by r. <sv...@ca...> - 2007-10-08 12:16:15
|
Author: rotman Date: 2007-10-08 14:16:13 +0200 (Mon, 08 Oct 2007) New Revision: 166 Modified: ChangeLog src/main/java/nl/improved/sqlclient/SQLUtil.java src/test/java/nl/improved/sqlclient/SQLUtilTest.java Log: Fix tab completion for in-word keyword matches Modified: ChangeLog =================================================================== --- ChangeLog 2007-10-08 10:50:54 UTC (rev 165) +++ ChangeLog 2007-10-08 12:16:13 UTC (rev 166) @@ -1,11 +1,12 @@ 0.3 (Unreleased) * focus fix in login dialog * Improve desc table to show primary key - * fix to stop spooled lines being appended to each other. + * BUGFIX: fix to stop spooled lines being appended to each other. * Improve tab completion for update - * NullPointerException fix when not running from jar. + * BUGFIX: NullPointerException fix when not running from jar. * Quit with ^D (on empty commandline) - * Added tab-completion for DESC command + * Added tab completion for DESC command + * BUGFIX: fix tab completion when a "keyword" was found as part of a name. 0.2 (17-09-2007) * Search in history (for example by entering '/query' to make the current command the last command with query in it) Modified: src/main/java/nl/improved/sqlclient/SQLUtil.java =================================================================== --- src/main/java/nl/improved/sqlclient/SQLUtil.java 2007-10-08 10:50:54 UTC (rev 165) +++ src/main/java/nl/improved/sqlclient/SQLUtil.java 2007-10-08 12:16:13 UTC (rev 166) @@ -27,13 +27,17 @@ public class SQLUtil { /** + * A regular expression statement for name chars. + */ + private static final String NAMING_CHAR = "(_|-|[0-9]|[A-Z])"; + /** * A table name regular expression statement. */ - private static final String TABLE = "[A-Z]+(_|-|[0-9]|[A-Z])*"; + private static final String TABLE = "[A-Z]+"+NAMING_CHAR+"*"; /** * A column name regular expression statement. */ - private static final String COLUMN = "[A-Z]+(_|-|[0-9]|[A-Z])*"; + private static final String COLUMN = "[A-Z]+"+NAMING_CHAR+"*"; /** * A variable (table name + columnname) regular expression statement. */ @@ -69,6 +73,15 @@ while (iKeywords.hasNext()) { String keyword = iKeywords.next(); int tmpIndex = seqUpper.indexOf(keyword); + int tmpEndIndex = tmpIndex+keyword.length(); + + //Ensuring the keyword is not a in-word match + if (tmpIndex > 0 && seqUpper.substring(tmpIndex-1, tmpIndex).matches(NAMING_CHAR)) { + continue; + } else if (tmpIndex != -1 && tmpEndIndex < seqUpper.length() && seqUpper.substring(tmpEndIndex, tmpEndIndex+1).matches(NAMING_CHAR)) { + continue; + } + if (tmpIndex > maxIndex) { maxIndex = tmpIndex; lastKeyWord = seq.substring(maxIndex, maxIndex+keyword.length()); Modified: src/test/java/nl/improved/sqlclient/SQLUtilTest.java =================================================================== --- src/test/java/nl/improved/sqlclient/SQLUtilTest.java 2007-10-08 10:50:54 UTC (rev 165) +++ src/test/java/nl/improved/sqlclient/SQLUtilTest.java 2007-10-08 12:16:13 UTC (rev 166) @@ -38,6 +38,10 @@ assertEquals("from", SQLUtil.getLastKeyWord(sql)); sql = "SELECT * FROM"; assertEquals("FROM", SQLUtil.getLastKeyWord(sql)); + sql = "DESC indummy"; + assertEquals("DESC", SQLUtil.getLastKeyWord(sql)); + sql = "DESC dummyin "; + assertEquals("DESC", SQLUtil.getLastKeyWord(sql)); } public void testTabCompletionInfoBLANK() { |
From: SVN by r. <sv...@ca...> - 2007-10-08 10:51:00
|
Author: rotman Date: 2007-10-08 12:50:54 +0200 (Mon, 08 Oct 2007) New Revision: 165 Modified: ChangeLog src/main/java/nl/improved/sqlclient/SQLShell.java src/main/java/nl/improved/sqlclient/SQLUtil.java src/test/java/nl/improved/sqlclient/SQLUtilTest.java Log: Added tab extention for desc Modified: ChangeLog =================================================================== --- ChangeLog 2007-10-08 09:49:45 UTC (rev 164) +++ ChangeLog 2007-10-08 10:50:54 UTC (rev 165) @@ -5,6 +5,7 @@ * Improve tab completion for update * NullPointerException fix when not running from jar. * Quit with ^D (on empty commandline) + * Added tab-completion for DESC command 0.2 (17-09-2007) * Search in history (for example by entering '/query' to make the current command the last command with query in it) Modified: src/main/java/nl/improved/sqlclient/SQLShell.java =================================================================== --- src/main/java/nl/improved/sqlclient/SQLShell.java 2007-10-08 09:49:45 UTC (rev 164) +++ src/main/java/nl/improved/sqlclient/SQLShell.java 2007-10-08 10:50:54 UTC (rev 165) @@ -25,6 +25,7 @@ import java.util.List; import java.util.logging.Level; import java.util.logging.Logger; +import javax.sound.midi.SysexMessage; import jcurses.widgets.Window; import jcurses.system.InputChar; import jcurses.system.Toolkit; @@ -558,6 +559,7 @@ return nullToEmpty(findMatch(info.getPossibleMatches(), info.getStart())); } if (info.getMatchType() == SQLUtil.TabCompletionInfo.MatchType.TABLE_NAMES) { + //debug("table completion for \""+info.getStart()+"\""); return nullToEmpty(findMatch(getTableNames(), info.getStart())); } if (info.getMatchType() == SQLUtil.TabCompletionInfo.MatchType.COLUMN_NAMES) { Modified: src/main/java/nl/improved/sqlclient/SQLUtil.java =================================================================== --- src/main/java/nl/improved/sqlclient/SQLUtil.java 2007-10-08 09:49:45 UTC (rev 164) +++ src/main/java/nl/improved/sqlclient/SQLUtil.java 2007-10-08 10:50:54 UTC (rev 165) @@ -47,7 +47,7 @@ */ private static final String VALUE = "('>*'|[0-9]+|"+VAR+")"; - public static List<String> KEYWORDS = Arrays.asList(new String[]{"SELECT", "UPDATE", "FROM", "WHERE", "VALUES", "SET", "INSERT", "INTO", "DELETE", "IS", "NULL", "IN", "NOT", "GROUP BY"}); + public static List<String> KEYWORDS = Arrays.asList(new String[]{"SELECT", "UPDATE", "FROM", "WHERE", "VALUES", "SET", "INSERT", "INTO", "DELETE", "IS", "NULL", "IN", "NOT", "GROUP BY", "DESC"}); /** * Private constructor. @@ -121,13 +121,13 @@ public static TabCompletionInfo getTabCompletionInfo(List<? extends CharSequence> commandInfo, Point commandPoint) { if (commandInfo.size() == 1 && commandInfo.get(0).length() == 0) { return new TabCompletionInfo(TabCompletionInfo.MatchType.SQL_KEYWORD - , Arrays.asList(new String[]{"SELECT", "INSERT INTO", "DELETE FROM", "UPDATE"})); + , Arrays.asList(new String[]{"SELECT", "INSERT INTO", "DELETE FROM", "UPDATE", "DESC"})); } String startOfCommand = getStartOfCommand(commandInfo, commandPoint); String lastKeyword = getLastKeyWord(startOfCommand); if (lastKeyword == null) { return new TabCompletionInfo(TabCompletionInfo.MatchType.SQL_KEYWORD - , Arrays.asList(new String[]{"SELECT", "INSERT INTO", "DELETE FROM", "UPDATE"}), startOfCommand); + , Arrays.asList(new String[]{"SELECT", "INSERT INTO", "DELETE FROM", "UPDATE", "DESC"}), startOfCommand); } if (lastKeyword.equalsIgnoreCase("UPDATE")) { String end = startOfCommand.substring(startOfCommand.lastIndexOf(' ')+1); @@ -242,6 +242,9 @@ } return new TabCompletionInfo(TabCompletionInfo.MatchType.SQL_KEYWORD , Arrays.asList(new String[]{"AND", "OR", "IN", "GROUP BY", "ORDER BY"})); + } else if (lastKeyword.equalsIgnoreCase("DESC")) { + String end = startOfCommand.substring(startOfCommand.lastIndexOf(' ')+1); + return new TabCompletionInfo(TabCompletionInfo.MatchType.TABLE_NAMES, new ArrayList<String>(), end); } return new TabCompletionInfo(TabCompletionInfo.MatchType.UNKNOWN, Arrays.asList(new String[0])); } Modified: src/test/java/nl/improved/sqlclient/SQLUtilTest.java =================================================================== --- src/test/java/nl/improved/sqlclient/SQLUtilTest.java 2007-10-08 09:49:45 UTC (rev 164) +++ src/test/java/nl/improved/sqlclient/SQLUtilTest.java 2007-10-08 10:50:54 UTC (rev 165) @@ -50,6 +50,8 @@ assertTrue(matches.contains("SELECT")); assertTrue(matches.contains("INSERT INTO")); assertTrue(matches.contains("DELETE FROM")); + assertTrue(matches.contains("UPDATE")); + assertTrue(matches.contains("DESC")); } public void testTabCompletionInfoSELECT() { @@ -315,4 +317,14 @@ assertEquals("A", matches.get(0)); assertEquals("", info.getStart()); } + + public void testTabCompletionInfoDESC() { + List<String> sqlCommand = Arrays.asList(new String[]{"DESC "}); + Point cursorPos = new Point(sqlCommand.get(0).length(),0); + SQLUtil.TabCompletionInfo info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos); + assertNotNull(info); + assertEquals(SQLUtil.TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType()); + List<String> matches = info.getPossibleMatches(); + assertEquals(0, matches.size()); + } } |
From: SVN by r. <sv...@ca...> - 2007-10-08 09:49:50
|
Author: rotman Date: 2007-10-08 11:49:45 +0200 (Mon, 08 Oct 2007) New Revision: 164 Modified: ChangeLog src/main/java/nl/improved/sqlclient/SQLShell.java Log: Add exit on ^D implementation Modified: ChangeLog =================================================================== --- ChangeLog 2007-10-02 09:57:31 UTC (rev 163) +++ ChangeLog 2007-10-08 09:49:45 UTC (rev 164) @@ -4,6 +4,7 @@ * fix to stop spooled lines being appended to each other. * Improve tab completion for update * NullPointerException fix when not running from jar. + * Quit with ^D (on empty commandline) 0.2 (17-09-2007) * Search in history (for example by entering '/query' to make the current command the last command with query in it) Modified: src/main/java/nl/improved/sqlclient/SQLShell.java =================================================================== --- src/main/java/nl/improved/sqlclient/SQLShell.java 2007-10-02 09:57:31 UTC (rev 163) +++ src/main/java/nl/improved/sqlclient/SQLShell.java 2007-10-08 09:49:45 UTC (rev 164) @@ -278,6 +278,10 @@ cursorPosition.x = 0; } else debug("Unknown character: "+ inp.getCode()); + } else if (inp.toString().equals("")) { //Ctrl+D + if (commandLines.getCommandString().length() == 0) { //Quit on empty commandline, ignore otherwise + new QuitCommand().execute(new SQLCommand()); + } } else { if (inp.getCharacter() == '\n') { // execute the command |
From: SVN by r. <sv...@ca...> - 2007-10-02 09:57:33
|
Author: roy Date: 2007-10-02 11:57:31 +0200 (Tue, 02 Oct 2007) New Revision: 163 Modified: src/main/java/nl/improved/sqlclient/SQLProperties.java Log: only put version when property file load succeeded Modified: src/main/java/nl/improved/sqlclient/SQLProperties.java =================================================================== --- src/main/java/nl/improved/sqlclient/SQLProperties.java 2007-10-02 09:34:21 UTC (rev 162) +++ src/main/java/nl/improved/sqlclient/SQLProperties.java 2007-10-02 09:57:31 UTC (rev 163) @@ -29,10 +29,10 @@ props = new Properties(); try { props.load(getClass().getResourceAsStream("/META-INF/maven/nl.improved/sqlshell/pom.properties")); + props.put(PropertyName.VERSION, props.get("version")); } catch(Exception e) { //System.err.println("Failed to load pom.properties"); } - props.put(PropertyName.VERSION, props.getProperty("version", "")); //Add an empty version as default } private static SQLProperties getInstance() { |
From: SVN by r. <sv...@ca...> - 2007-10-02 09:34:24
|
Author: rotman Date: 2007-10-02 11:34:21 +0200 (Tue, 02 Oct 2007) New Revision: 162 Added: ChangeLog Modified: README Log: moved changes per version to ChangeLog Added: ChangeLog =================================================================== --- ChangeLog (rev 0) +++ ChangeLog 2007-10-02 09:34:21 UTC (rev 162) @@ -0,0 +1,45 @@ +0.3 (Unreleased) + * focus fix in login dialog + * Improve desc table to show primary key + * fix to stop spooled lines being appended to each other. + * Improve tab completion for update + * NullPointerException fix when not running from jar. + +0.2 (17-09-2007) + * Search in history (for example by entering '/query' to make the current command the last command with query in it) + * \n always tries to execute the command even if you are not at the end of the command + * Show tables (show a list of tables that is available for querying) + * BUGFIX: handle large results a bit better (memory wise) + * BUGFIX: fix tabcompletion when cursor not at the end of the sql string + * tab completion improvements + * Make columns in select query fit the max result with instead of the max column width + * make command help include list of known connections + * make spool command include status + * edit fixes + * help improvements + * make all commands match [\s]*[command][\s]*(|;) + * typing 'not at the end of a line' and the line becomes too large.. strange things happen... + * improved readability of desc table command + * desc of not existing table doesn't give an error + * replace ~ in ~/* for user home dir (for spool command) + * made '@' appear in help as well + * Improve desc table to show not null + * scroll all the way down when key typed that is not pageup/down + +0.1 + * connection settings via db.properties and input of password in a seperate dialog + configuration can be done by editing a simple db.properties file + * command history (key up/down) + * spool + * read sql script files and execute them + * (initial) tab completion + * when more matches show all matches in the output window + * if less then predefined max show matches in a selection window + * if only one match select that match + * desc table (initial) + * page up/down support + * info: show info of the current connection + * history: shows last executed commands + * help: provide some help about the available commands and it's usage + * remove prompt at the start of the command after executing to make it easier to copy/paste commands that are devided into multiple lines + * added support for 'show tables having column' Modified: README =================================================================== --- README 2007-10-02 09:30:44 UTC (rev 161) +++ README 2007-10-02 09:34:21 UTC (rev 162) @@ -21,52 +21,8 @@ TODO CURRENT FEATURES -0.1 -- connection settings via db.properties and input of password in a seperate dialog - configuration can be done by editing a simple db.properties file -- command history (key up/down) -- spool -- read sql script files and execute them -- (initial) tab completion - - when more matches show all matches in the output window - - if less then predefined max show matches in a selection window - - if only one match select that match -- desc table (initial) -- page up/down support -- info: show info of the current connection -- history: shows last executed commands -- help: provide some help about the available commands and it's usage -- remove prompt at the start of the command after executing to make it easier to copy/paste commands that are devided into multiple lines -- added support for 'show tables having column' +[See ChangeLog] -0.2 (17-09-2007 -- Search in history (for example by entering '/query' to make the current command the last command with query in it) -- \n always tries to execute the command even if you are not at the end of the command -- Show tables (show a list of tables that is available for querying) -- BUGFIX: handle large results a bit better (memory wise) -- BUGFIX: fix tabcompletion when cursor not at the end of the sql string -- tab completion improvements -- Make columns in select query fit the max result with instead of the max column width -- make command help include list of known connections -- make spool command include status -- edit fixes -- help improvements -- make all commands match [\s]*[command][\s]*(|;) -- typing 'not at the end of a line' and the line becomes too large.. strange things happen... -- improved readability of desc table command -- desc of not existing table doesn't give an error -- replace ~ in ~/* for user home dir (for spool command) -- made '@' appear in help as well -- Improve desc table to show not null -- scroll all the way down when key typed that is not pageup/down - -0.3 (Unreleased) -- focus fix in login dialog -- Improve desc table to show primary key -- fix to stop spooled lines being appended to each other. -- Improve tab completion for update -- NullPointerException fix when not running from jar. - FUTURE - Improve desc table (to show references, etc) - Improve tab completion for update, delete and alter table queries |
From: SVN by r. <sv...@ca...> - 2007-10-02 09:30:46
|
Author: rotman Date: 2007-10-02 11:30:44 +0200 (Tue, 02 Oct 2007) New Revision: 161 Modified: README Log: mention fix Modified: README =================================================================== --- README 2007-10-02 09:24:45 UTC (rev 160) +++ README 2007-10-02 09:30:44 UTC (rev 161) @@ -65,6 +65,7 @@ - Improve desc table to show primary key - fix to stop spooled lines being appended to each other. - Improve tab completion for update +- NullPointerException fix when not running from jar. FUTURE - Improve desc table (to show references, etc) |
From: SVN by r. <sv...@ca...> - 2007-10-02 09:24:52
|
Author: rotman Date: 2007-10-02 11:24:45 +0200 (Tue, 02 Oct 2007) New Revision: 160 Modified: src/main/java/nl/improved/sqlclient/SQLProperties.java Log: Avoid NullPointerException when not running from jar. Modified: src/main/java/nl/improved/sqlclient/SQLProperties.java =================================================================== --- src/main/java/nl/improved/sqlclient/SQLProperties.java 2007-09-30 09:54:09 UTC (rev 159) +++ src/main/java/nl/improved/sqlclient/SQLProperties.java 2007-10-02 09:24:45 UTC (rev 160) @@ -32,7 +32,7 @@ } catch(Exception e) { //System.err.println("Failed to load pom.properties"); } - props.put(PropertyName.VERSION, props.get("version")); + props.put(PropertyName.VERSION, props.getProperty("version", "")); //Add an empty version as default } private static SQLProperties getInstance() { |
From: SVN by r. <sv...@ca...> - 2007-09-30 09:54:12
|
Author: roy Date: 2007-09-30 11:54:09 +0200 (Sun, 30 Sep 2007) New Revision: 159 Modified: README Log: mention changes Modified: README =================================================================== --- README 2007-09-30 09:48:08 UTC (rev 158) +++ README 2007-09-30 09:54:09 UTC (rev 159) @@ -62,11 +62,13 @@ 0.3 (Unreleased) - focus fix in login dialog +- Improve desc table to show primary key - fix to stop spooled lines being appended to each other. +- Improve tab completion for update FUTURE -- Improve desc table (to show primary key, references, etc) -- Improve tab completion for delete and alter table queries +- Improve desc table (to show references, etc) +- Improve tab completion for update, delete and alter table queries - Highlight the commands to make a distinction between the output and the commands - Remember commands over sessions - Make it possible to export/import data via xml (I think there is even an xml standard for this) |
From: SVN by r. <sv...@ca...> - 2007-09-30 09:48:11
|
Author: roy Date: 2007-09-30 11:48:08 +0200 (Sun, 30 Sep 2007) New Revision: 158 Modified: pom.xml Log: removed oracle dependancy Modified: pom.xml =================================================================== --- pom.xml 2007-09-30 09:47:31 UTC (rev 157) +++ pom.xml 2007-09-30 09:48:08 UTC (rev 158) @@ -46,12 +46,6 @@ <version>1.8.0.7</version> </dependency> <dependency> - <groupId>db</groupId> - <artifactId>oracle</artifactId> - <version>1.4</version> - <scope>test</scope> - </dependency> - <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> |
From: SVN by r. <sv...@ca...> - 2007-09-30 09:47:41
|
Author: roy Date: 2007-09-30 11:47:31 +0200 (Sun, 30 Sep 2007) New Revision: 157 Modified: src/main/java/nl/improved/sqlclient/SQLUtil.java src/test/java/nl/improved/sqlclient/SQLUtilTest.java Log: slight improvement of update tab completion Modified: src/main/java/nl/improved/sqlclient/SQLUtil.java =================================================================== --- src/main/java/nl/improved/sqlclient/SQLUtil.java 2007-09-28 14:09:32 UTC (rev 156) +++ src/main/java/nl/improved/sqlclient/SQLUtil.java 2007-09-30 09:47:31 UTC (rev 157) @@ -47,7 +47,7 @@ */ private static final String VALUE = "('>*'|[0-9]+|"+VAR+")"; - public static List<String> KEYWORDS = Arrays.asList(new String[]{"SELECT", "FROM", "WHERE", "VALUES", "SET", "INSERT", "INTO", "DELETE", "IS", "NULL", "IN", "NOT", "GROUP BY"}); + public static List<String> KEYWORDS = Arrays.asList(new String[]{"SELECT", "UPDATE", "FROM", "WHERE", "VALUES", "SET", "INSERT", "INTO", "DELETE", "IS", "NULL", "IN", "NOT", "GROUP BY"}); /** * Private constructor. @@ -121,20 +121,41 @@ public static TabCompletionInfo getTabCompletionInfo(List<? extends CharSequence> commandInfo, Point commandPoint) { if (commandInfo.size() == 1 && commandInfo.get(0).length() == 0) { return new TabCompletionInfo(TabCompletionInfo.MatchType.SQL_KEYWORD - , Arrays.asList(new String[]{"SELECT", "INSERT INTO", "DELETE FROM"})); + , Arrays.asList(new String[]{"SELECT", "INSERT INTO", "DELETE FROM", "UPDATE"})); } String startOfCommand = getStartOfCommand(commandInfo, commandPoint); String lastKeyword = getLastKeyWord(startOfCommand); if (lastKeyword == null) { return new TabCompletionInfo(TabCompletionInfo.MatchType.SQL_KEYWORD - , Arrays.asList(new String[]{"SELECT", "INSERT INTO", "DELETE FROM"}), startOfCommand); + , Arrays.asList(new String[]{"SELECT", "INSERT INTO", "DELETE FROM", "UPDATE"}), startOfCommand); } - if (lastKeyword.equalsIgnoreCase("SELECT")) { + if (lastKeyword.equalsIgnoreCase("UPDATE")) { + String end = startOfCommand.substring(startOfCommand.lastIndexOf(' ')+1); + String upCommand = startOfCommand.toUpperCase(); + if (upCommand.matches("UPDATE[\\s]+"+TABLE+"[\\s]+(|S|SE|SET)")) { + return new TabCompletionInfo(TabCompletionInfo.MatchType.SQL_KEYWORD, Arrays.asList(new String[]{"SET"}), end); + } + if (upCommand.matches("UPDATE[\\s]+"+TABLE+"[\\s]+SET[\\s]+")) { + String tableName = upCommand.substring("UPDATE".length()); + tableName = tableName.substring(0, tableName.indexOf("SET")).trim(); + return new TabCompletionInfo(TabCompletionInfo.MatchType.COLUMN_NAMES, Arrays.asList(tableName), end); + } + return new TabCompletionInfo(TabCompletionInfo.MatchType.TABLE_NAMES, new ArrayList<String>(), end); + } else if (lastKeyword.equalsIgnoreCase("SET")) { + String end = startOfCommand.substring(startOfCommand.lastIndexOf(' ')+1); + String upCommand = startOfCommand.toUpperCase(); + if (upCommand.matches("UPDATE[\\s]+"+TABLE+"[\\s]+SET[\\s]+")) { + String tableName = upCommand.substring("UPDATE".length()); + tableName = tableName.substring(0, tableName.indexOf("SET")).trim(); + return new TabCompletionInfo(TabCompletionInfo.MatchType.COLUMN_NAMES, Arrays.asList(tableName), end); + } + } else if (lastKeyword.equalsIgnoreCase("SELECT")) { // if it looks like: // SELECT x // return "FROM" - if (startOfCommand.trim().length() > "SELECT".length()) { - if (startOfCommand.substring("SELECT".length()).matches("[\\s]*(\\*|"+VAR+"[\\s])([\\s]*,[\\s]*"+VAR+"+)*( |\t)*(|F|FR|FRO|FROM|f|fr|fro|from)")) { + String upCommand = startOfCommand.trim().toUpperCase(); + if (upCommand.length() > "SELECT".length()) { + if (upCommand.substring("SELECT".length()).matches("[\\s]*(\\*|"+VAR+"[\\s])([\\s]*,[\\s]*"+VAR+"+)*( |\t)*(|F|FR|FRO|FROM)")) { String end = startOfCommand.substring(startOfCommand.lastIndexOf(' ')+1); return new TabCompletionInfo(TabCompletionInfo.MatchType.SQL_KEYWORD , Arrays.asList(new String[]{"FROM"}), end); @@ -222,7 +243,6 @@ return new TabCompletionInfo(TabCompletionInfo.MatchType.SQL_KEYWORD , Arrays.asList(new String[]{"AND", "OR", "IN", "GROUP BY", "ORDER BY"})); } - return new TabCompletionInfo(TabCompletionInfo.MatchType.UNKNOWN, Arrays.asList(new String[0])); } Modified: src/test/java/nl/improved/sqlclient/SQLUtilTest.java =================================================================== --- src/test/java/nl/improved/sqlclient/SQLUtilTest.java 2007-09-28 14:09:32 UTC (rev 156) +++ src/test/java/nl/improved/sqlclient/SQLUtilTest.java 2007-09-30 09:47:31 UTC (rev 157) @@ -285,4 +285,34 @@ assertTrue(tableNames.contains("A")); } + public void testUpdateTabCompletion() { + List<String> sqlCommand = Arrays.asList(new String[]{"UPDATE A"}); + Point cursorPos = new Point(sqlCommand.get(0).length(),0); + SQLUtil.TabCompletionInfo info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos); + assertNotNull(info); + assertEquals(SQLUtil.TabCompletionInfo.MatchType.TABLE_NAMES, info.getMatchType()); + List<String> matches = info.getPossibleMatches(); + assertEquals(0, matches.size()); + assertEquals("A", info.getStart()); + + sqlCommand = Arrays.asList(new String[]{"UPDATE A "}); + cursorPos = new Point(sqlCommand.get(0).length(),0); + info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos); + assertNotNull(info); + assertEquals(SQLUtil.TabCompletionInfo.MatchType.SQL_KEYWORD, info.getMatchType()); + matches = info.getPossibleMatches(); + assertEquals(1, matches.size()); + assertEquals("SET", matches.get(0)); + assertEquals("", info.getStart()); + + sqlCommand = Arrays.asList(new String[]{"UPDATE A SET "}); + cursorPos = new Point(sqlCommand.get(0).length(),0); + info = SQLUtil.getTabCompletionInfo(sqlCommand, cursorPos); + assertNotNull(info); + assertEquals(SQLUtil.TabCompletionInfo.MatchType.COLUMN_NAMES, info.getMatchType()); + matches = info.getPossibleMatches(); + assertEquals(1, matches.size()); + assertEquals("A", matches.get(0)); + assertEquals("", info.getStart()); + } } |
From: SVN by r. <sv...@ca...> - 2007-09-28 14:09:37
|
Author: roy Date: 2007-09-28 16:09:32 +0200 (Fri, 28 Sep 2007) New Revision: 156 Modified: pom.xml Log: fixed reference to hsqldb jar Modified: pom.xml =================================================================== --- pom.xml 2007-09-28 12:54:41 UTC (rev 155) +++ pom.xml 2007-09-28 14:09:32 UTC (rev 156) @@ -43,7 +43,7 @@ <dependency> <groupId>hsqldb</groupId> <artifactId>hsqldb</artifactId> - <version>1.8.0</version> + <version>1.8.0.7</version> </dependency> <dependency> <groupId>db</groupId> |
From: SVN by r. <sv...@ca...> - 2007-09-28 12:54:42
|
Author: rotman Date: 2007-09-28 14:54:41 +0200 (Fri, 28 Sep 2007) New Revision: 155 Modified: README Log: add fix Modified: README =================================================================== --- README 2007-09-28 12:53:04 UTC (rev 154) +++ README 2007-09-28 12:54:41 UTC (rev 155) @@ -62,6 +62,7 @@ 0.3 (Unreleased) - focus fix in login dialog +- fix to stop spooled lines being appended to each other. FUTURE - Improve desc table (to show primary key, references, etc) |
From: SVN by r. <sv...@ca...> - 2007-09-28 12:53:11
|
Author: rotman Date: 2007-09-28 14:53:04 +0200 (Fri, 28 Sep 2007) New Revision: 154 Modified: src/main/java/nl/improved/sqlclient/SQLShell.java Log: Bugfix for spooled lines being appended to each other. Modified: src/main/java/nl/improved/sqlclient/SQLShell.java =================================================================== --- src/main/java/nl/improved/sqlclient/SQLShell.java 2007-09-20 12:51:38 UTC (rev 153) +++ src/main/java/nl/improved/sqlclient/SQLShell.java 2007-09-28 12:53:04 UTC (rev 154) @@ -415,6 +415,7 @@ if (spoolWriter != null) { try { spoolWriter.write(data.toString()); + spoolWriter.write("\n"); } catch(IOException e) { screenBuffer.add("WARNING: Could not write to spool file"); error(e); |
From: SVN by r. <sv...@ca...> - 2007-09-20 12:51:45
|
Author: roy Date: 2007-09-20 14:51:38 +0200 (Thu, 20 Sep 2007) New Revision: 153 Modified: src/main/java/nl/improved/sqlclient/commands/DescCommand.java Log: show primary key Modified: src/main/java/nl/improved/sqlclient/commands/DescCommand.java =================================================================== --- src/main/java/nl/improved/sqlclient/commands/DescCommand.java 2007-09-19 09:04:54 UTC (rev 152) +++ src/main/java/nl/improved/sqlclient/commands/DescCommand.java 2007-09-20 12:51:38 UTC (rev 153) @@ -65,6 +65,26 @@ if (!rs.next()) { return "Failed to find table '"+tableName+"'"; } + } else { + rs = conn.getMetaData().getPrimaryKeys(conn.getCatalog(), DBConnector.getInstance().getSchema(), tableName); + StringBuffer footer = new StringBuffer(); + String indent = " "; + while (rs.next()) { + if (footer.length() > 0) { + footer.append(",\n"); + } else { + footer.append("PRIMARY KEY"); + String pkName = rs.getString("PK_NAME"); + if (pkName != null && pkName.length() > 0) { + footer.append(' '); + footer.append(pkName); + } + footer.append(":\n"); + } + footer.append(indent); + footer.append(rs.getString("COLUMN_NAME")); + } + result.setFooter(footer); } } catch (SQLException ex) { throw new IllegalStateException("Failed to find columnnames for table: "+ tableName, ex); |
From: SVN by r. <sv...@ca...> - 2007-09-19 09:05:01
|
Author: roy Date: 2007-09-19 11:04:54 +0200 (Wed, 19 Sep 2007) New Revision: 152 Modified: README Log: mention another feature Modified: README =================================================================== --- README 2007-09-18 13:01:03 UTC (rev 151) +++ README 2007-09-19 09:04:54 UTC (rev 152) @@ -78,3 +78,4 @@ - Large query results don't show (> 300.000 rows?) - 'where x' doesn't autocomplete table names - make ctrl+j (for example) auto insert join +- make ctrl+c abort query |