Skip to content

Instantly share code, notes, and snippets.

@hkoba
Created April 7, 2014 09:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hkoba/10017451 to your computer and use it in GitHub Desktop.
Save hkoba/10017451 to your computer and use it in GitHub Desktop.
tksqlite patch: to show results from sql query starting "with" - a.k.a. "CTE, common table expression". See http://www.sqlite.org/lang_with.html
--- a/tksqlite.tcl
+++ b/tksqlite.tcl
@@ -8703,7 +8703,8 @@ proc Sqlite::publish {query tableName rawdataName} {
set _temp [string map {, { } \" {}} $query]
set _temp [SQLParser::removeComment $_temp]
set sqlcmd [string tolower [lindex $_temp 0]]
- if {$sqlcmd ne "select" &&
+ if {$sqlcmd ne "select" &&
+ $sqlcmd ne "with" &&
$sqlcmd ne "pragma" &&
$sqlcmd ne "explain"} {
.table.f.table configure -rows 1 -cols 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment