Index†
What is This?†
TkSQLite is a GUI database manager for SQLite implemented by Tcl/Tk.
It can manage SQLite version2.8 and SQLite version3.x database. And it can handle many
encodings like Shift-JIS, EUC-JP and Windows native milti-byte
encodings not only UTF-8. And it can run on Windows and Linux
and MacOSX as native Look & Feel. And it's Freeware.
Features†
- Support SQLite2.8 and SQLite3.x db.
- Support many encodings not only utf-8.
- Edit table with grid table.
- Change table schema.
- Show images in BLOB data.(Sqlite3)
- Syntax keyword hilighting.
- Native Look & Feel.
- Japanese and English locale.
- Many functions (md5, sha1, des, etc. see SQLite user function)
- Run on any platform Tcl/Tk can.
- Attach and Detach Database.
- Export and Import CSV.
- Dump a database to SQL.
- Support loadable extension.
Requirements†
NOTE:
Tablelist4.5+ is still required by tksqlite 0.4.
But tksqlite 0.5 requires Treectrl2.1+ instead of Tablelist.
ActiveTcl has all of these precompiled extensions. I really recommend to install it if you are not familiar with tcl/tk environment.
Uninstall†
remove tksqlite.tcl and, rm ~/.tksqlite on linux or %APPDATA%/tksqlite/.tksqlite on windows
License†
New BSD style license.
Screenshot†
ver0.5 English version on Vista
ver0.4 Japanese version on Linux
Download†
Note: Please take care of compatibility of file format.
see also
http://www.sqlite.org/changes.html
http://www.sqlite.org/formatchng.html
Update History†
- 0.2.1 (2005-11-04)
- Fix table bug "PRAGMA" result was not shown
- Fix syntax hilighting bug
- Fix index property bug
- 0.2.2 (2005-11-18)
- Fix syntax hilighting bug
- Fix selection of attached database bug
- FIxed bug of grid table's insert row mode.
- 0.2.3 (2005-11-21)
- Fix grid table bug that deleting row makes rowid shifts.
- 0.2.4 (2005-11-26)
- Fix encoding bug, data was garbled, when euc-jp on sqlite3.
- 0.3 (2005-12-04)
- Create Table Dialog, Create Index Dialog and Preference Dialog.
- Improvement of Look & Feel.
- Sort Grid Table command.
- Search Dialog for Grid Table.
- Add Option of Vi like keybind for Grid Table.
- Attach/Detach db menu.
- Import/Export SQL and CSV(or Tab)
- Add many db functions(regexp, regsub, md5 etc).
- 0.3.1 (2005-12-14)
- A Project name was renamed to TkSQLite.
- Fix a csv import bug that a data having single quote char causes error.
- Fix a session bug that TkSQLite wasn't able to recover correct window position on Windows.
- Fix a editor bug that brace char causes a error.
- 0.3.2 (2006-06-08)
- Made Standalone binary version.
- Unified Japanese and English version. Locale is automatically selected now.
- Fix sqlite init bug.
- 0.4.0 (2006-08-04)
- Require dict, Trf, tablelist and tkImg packages.
- Improvement of Keyword Highlight.
- Improvement of Preference, CreateTable and CreateIndex Dialogs.
- Add 3.x compatible format mode option. (in Preference -> SQLite)
- Add Cache size Dialog.
- Add DataEditor Dialog.
- Enable to change table schema.
- Enable to view images in BLOB data.(gif, jpeg, png, bmp, ico, tiff, tga, ppm (require tkImg))
- Speed up base64 encode/decode.
- New user function compress, decompress, read_file and write_file. (see SQLite user function)
- Add binary mode to crypt user function (md5, sha1, base64_encode, etc). (see SQLite user function)
- 0.4.1 (2006-08-13)
- update to sqlite 3.3.7 in executable standalone version
- Fix a little bug of legacy file format option.
- (source tcl script isn't modified) (2007-01-11)
- update to sqlite 3.3.10 in executable standalone version
- (source tcl script isn't modified) (2007-01-23)
- update to sqlite 3.3.11 in executable standalone version
- (source tcl script isn't modified) (2007-01-28)
- update to sqlite 3.3.12 in executable standalone version
- 0.4.2 (2007-02-15)
- Pay attention to utf8/utf16(unicode) byte order mark when importing/exporting text.(thanks to Deneufchatel Renaud)
- Fix some gui bugs.
- update to sqlite 3.3.13 in executable standalone version
- 0.4.3 (2007-03-13)
- Fix typo of Trf package loading.
- Improvement of native look & feel on xpnative, winnative, clam(on unix) theme.
- Readiness for tk8.5a6(or b1?) and tile0.8. tksqlite now works with these last versions. But it is still on the anvil. (thanks to Julian Noble)
- Fix some gui bugs.
- (source tcl script isn't modified) (2007-04-05)
- update to sqlite 3.3.14 in executable standalone version.
- A tclkit of linux was compiled with thread-enabled option.
- (source tcl script isn't modified) (2007-04-09)
- update to sqlite 3.3.15 in executable standalone version.
- (source tcl script isn't modified) (2007-04-23)
- update to sqlite 3.3.16 in executable standalone version.
- (source tcl script isn't modified) (2007-04-29)
- update to sqlite 3.3.17 in executable standalone version.
- 0.4.4 (2007-05-25)
- Improved a behavior of grid-table. If a new row was created and a column had default value, the value would be set instead of empty string.
- Fixed some startup errors on Mac OS X.
- Changed Modifier key to be a Command key on Mac OS X.
- Fixed right-mouse button behavior on Mac OS X. (thanks to Andre Berger!)
- Changed Shortcuts. Now "Select All" is Ctrl-A. (or Cmd-A on Mac OS X)
- Fixed and Improved Look and Feel a little.
- Fixed a garbled string on japanese locale.
- Improved fonts.
- Updated Tcl/Tk version in standalone version to 8.5(CVS HEAD. now it was 8.5a7). And The Linux version was compiled as an enable-xft. So you can see anti-aliased font. If you want a standalone without xft, e-mail me or post a comment in this page.
- 0.4.5 (2007-05-28)
- Fixed conflict of context menu bindings and default widgets bindings on Mac OS X.(thanks to Andre Berger!)
- 0.4.6 (2007-06-20)
- Fixed garbled string inputted by xim on unix, if encoding isn't utf-8.
- Added cp51932 encoding to standalone version.
- Updated to sqlite 3.4.0 in executable standalone version.
- 0.4.7 (2007-07-04)
- New message dialog, backport from 0.5.0.
- Fixed bugs, backport from 0.5.0.
But garbled string when using multibyte encoding (shiftjis, euc-jp, etc) on sqlite3 is not fixed. If the db has the combination, export it on tksqlite0.4, and import the data to new database on tksqlite0.5. If the db is utf-8 on sqlite3 or sqlite2 db is used, this problem didn't occured.
- 0.5.0 (2007-07-04)
- Require tktreectrl2.1+ instead of tablelist.
- Added CreateTrigger Dialog.
- Added a new file selection dialog ( http://wiki.tcl.tk/15897 ).
- Improved widgets L&F on WindowsXP at tile0.8.
- Improved DataEditor Dialog.
- Enabled to load loadable extension and user tcl script.
- Enabled to create UTF-16le, UTF-16be database.
- New message dialog. I avoided to use ttk::dialog. Because I noticed that the ttk::dialog was removed in Tk8.5a7 CVS HEAD. And this dialog shows a long message in textbox.
- Used tclkit lite to avoid libstdc++ dependency on linux standalone version. I have a bit of concern about the tclkitlite works fine.
- Updated Tcl/Tk to CVS HEAD used in standalone version.
- Fixed garbled string when db is multibyte encoding on sqlite3.
- Fixed sql parser error if "CREATA TABLE" query has "DEFAULT NULL".
- Fixed delete row error if using multibyte encoding on sqlite3.
- (source tcl script isn't modified) (2007-07-21)
- update to sqlite 3.4.1 in executable standalone version.
- 0.5.1 (2007-08-04)
- Fixed a little bug building an invalid CREATE TRIGGER query.
- Fixed a suspicious behavior of a grid table.
- Improved import/export text dialog. The dialogs can set custom quote and separator.
- Improved a modify table scheme dialog. When you add a new column to a table and the column has default constraint, the column fillled with the default value.
- Improved some GUI interface.
- 0.5.2 (2007-08-14)
- Fixed odd behavior of a grid table.
- Fixed a bug that sql parser could not parse DEFAULT clause which has minus number or quoted string.
- Fixed a but that if "NULL" was enterd in DEFAULT text entry on CreateTable Dialog, the value was not used as string "NULL" but real NULL.
- (source tcl script isn't modified) (2007-08-16)
- update to sqlite 3.4.2 in executable standalone version.
- 0.5.3 (2007-09-04)
- Improved gui a little.
- Fixed a conflict between tclsqlite and last Tcl8.5a7 which reformed Var struct.
- Fixed a text sticking out of cell in grid table. The problem was caused on xft-enabled tk8.5 only.
- 0.5.4 (2007-09-05)
- Fixed a bug that CSV(Text) Importer couldn't break out of the infinite loop, if the text had invalid sequence.
- Fixed a left-over conflict between tclsqlite and last Tcl8.5a7.
- Improved speed of setting data on grid-table.
- 0.5.5 (2007-10-08)
- Updated to sqlite 3.5.1 in executable standalone version
- Updated to Tcl/Tk 8.5b1 in executable standalone version
- Refactored a little.
- (source tcl script isn't modified) (2007-10-12)
- Fixed a startup error that standalone version for win32 didn't run on WindowsXP.
- (source tcl script isn't modified) (2007-11-16)
- update to sqlite 3.5.2 in executable standalone version.
- 0.5.6 (2007-12-04)
- Updated to sqlite 3.5.3 in executable standalone version
- Updated to Tcl/Tk 8.5b3 in executable standalone version
- Fixed file selection dialog error that called ttk::dialog.
- Fixed auto_path error when tksqlite is executed by starkit. (but I didn't test it...)
- (source tcl script isn't modified) (2007-12-15)
- Updated to sqlite 3.5.4 in executable standalone version.
- (source tcl script isn't modified) (2008-02-02)
- Updated to sqlite 3.5.5 in executable standalone version.
- Updated to Tcl/Tk 8.5.1b1 in executable standalone version.
- (source tcl script isn't modified) (2008-03-23)
- Updated to sqlite 3.5.7 in executable standalone version.
- Updated to Tcl/Tk 8.5.1 in executable standalone version.
- (source tcl script isn't modified) (2008-07-17)
- Updated to sqlite 3.6.0 in executable standalone version.
- Updated to Tcl/Tk 8.5.3 in executable standalone version.
- 0.5.7 (2008-11-17)
- updated to sqlite 3.6.5 in executable standalone version.
- Updated to Tcl/Tk 8.5.5 in executable standalone version.
- Updated to Tktable2.10 in executable standalone version.
- Updated to Treectrl2.2.8 in executable standalone version.
- Updated to Tcllib1.11 in executable standalone version.
- Fixed a bug, if column name was reserved keyword, "Modify Table schema" Dialog failed to change the column name.
- Fixed init file ".tksqlite" could not save on Windows Vista, TkSQLite 0.5.7 will read/write the file in %APPDATA%/tksqlite directory on Windows. If you have old .tksqlite, copy it to be %APPDATA%/tksqlite/.tksqlite. It still saved in home directory on other platforms.
- Enable to set DEFAULT value on "Modify Table schema" Dialog to be CURRENT_DATE, CURRENT_TIME, CURRENT_TIMESTAMP, expr such like (DATETIME(CURRENT_TIMESTAMP, 'localtime')). Notice that CURRENT_* are allowed only the column type is DATE, TIME, DATETIME or TIMESTAMP only. If another column data type is used, the value will be string 'CURRENT_TIMESTAMP'.
- If SQL Editor has selection, and you push Ctrl-Enter (Shortcut for execution query), then only the selected range will be executed.
- 0.5.8 (2009-03-07)
- updated to sqlite 3.6.11 in executable standalone version.
- Fixed a bug, grid table's cell editor escaped single quote char twice.
- Enable to use collation list from sqlite3 pragma collation_list on table schema editor.
- 0.5.9 (2013-04-27)
- update to sqlite 3.7.14 in executable standalone version.
- Enable to build standalone verison for OSX.
- Change theme to clam on OSX.
- Drop user defined function left, right.
- Add user defined function exec.
- Fixed a bug, failed to get library version on Tcl/Tk 8.6.
- Fixed a bug, a modal dialog was locked on OSX (aqua windowing system ?).
- Fixed a bug, 001 was commited as 1 in cell editor.
- 0.5.10 (2013-07-20)
- Fixed a bug that table editor points another rowid on linux (sqlite3.7?).
- 0.5.11 (2014-04-09)
- Enabled to run Common Table Expressions.
- Skip loading a function if the function is already exists as sqlite built-in.
- Add printf function.
- 0.5.11-1 (2014-05-12)
- Same as 0.5.11. But updated the Tcl/Tk runtime to 8.6.1 using standalone version.
- 0.5.11-2 (2014-05-23)
- Same as 0.5.11. But binary versions include sqlite3 with FTS4 unicode61 tokenizer support.
- 0.5.11-3 (2014-05-29)
- Same as 0.5.11. But fixed binary versions to include some japanese encodings they were dropped sinse 0.5.11-1.
- 0.5.12 (2015-11-06)
- Add option for Unicode BOM at Export CSV Dialog.
- 0.5.13 (2016-04-29)
- Fixed some dialogs move over out of screen when using multiple monitors.
- Fixed size of maximized window is not recovered by session.
- Upgrade to sqlite 3.12.2 in executable standalone version.
How to use†
Create Table and Index†
Key Binding†
- Editor
Normal keybind |
Ctrl+Return | Execute sql |
Ctrl-Delete | Clear all |
- GridTable
- Normal mode
Normal keybind |
Ctrl+n | Insert Row |
Ctrl+d | Delete Row |
F5 | Update Grid Table |
Vi keybind |
h | Move left |
j | Move down |
k | Move up |
l | Move right |
o | Insert row |
slash | Show Search Dialog |
gg | Move top |
G | Move bottom |
u | Update Grid Table |
- Cell Edit mode
Normal keybind |
Escape | Cancel Editing |
Return | Commit and move down |
Shift+Return | Commit and move up |
Ctrl+Return | Commit |
Alt+Return | Insert Return |
Left | Commit and move left |
Right | Commit and move right |
Tab | Commit and move next |
Shift+Tab | Commit and move prev |
Vi keybind |
Ctrl+h | Commit and begin editing left |
Ctrl+j | Commit and begin editing down |
Ctrl+k | Commit and begin editing up |
Ctrl+l | Commit and begin editing right |
- Insert new row
Normal keybind |
Escape | Cancel |
Return | Commit |
Shift+Return | Commit and move up |
Ctrl+Return | Commit |
Alt+Return | Insert |
Up | Commit and move up |
Down | Commit |
Left | move left |
Right | move right |
Tab | move next |
Shift+Tab | move prev |
Vi keybind |
Ctrl+h | same as Left |
Ctrl+j | same as Down |
Ctrl+k | same as Up |
Ctrl+l | same as Right |
- DataEditor(Text) (this binding is enable on tksqlite0.5+)
Normal keybind |
Ctrl+Return | Update |
Vi keybind |
Ctrl-h | Move left grid table cursor |
Ctrl-j | Move down grid table cursor |
Ctrl-k | Move up grid table cursor |
Ctrl-l | Move right grid table cursor |
Import/Export CSV†
- Import CSV Dialog
- If "First Line is Field Name" was checked and an existing table didn't have the field,
TkSQLite try to insert empty string or NULL(if the col was integer primary key) to the field.
- Leading spaces adjacent to separator are trimmed.
- Fields with embedded separator must be delimited with quote characters.
- The embedded quote characters must be represented by a pair of quote characters.
Functions†
TkSQLite have many user functions emulated some other DB's functions. See SQLite user function.
- Some example
- perl5 like regexp. (this is Tcl regexp command. see also Syntax of Tcl regular expressions.)
select * from t where name regexp "^J.*"
- regsub(pattern, colname, str). You can use submach pattern like \1 too.
insert into t
select regsub("syo", name, "sho") from t2
select regsub("(\d{4})(\d{2})(\d{2}).*", "20050401", "\1-\2-\3")
2005-04-01
- MD5(requires Tcllib).
select md5(name) from t
Loading tcl script functions.†
tksqlite 0.5 can load tcl script functions. The interface is tclsqlite.
You can access the db command. It is just a sqlite database command.
But don't use another sub commands except for db function, because
the command is used by tksqlite. Don't rename and free the command too.
The loading process is
- db is opened.
- default sqlite functions is installed.
- registerd tcl scripts are sourced.
Example:
plus.tcl
proc plusProc {a b} {
if {[string is double $a] && [string is double $b]} {
return [expr {$a + $b}]
}
return [append a $b]
}
db function plus plusProc
Register this script in Preference Dialog, and check Enable.
Then open a database file and You can use the plus func.
select plus(1,1)
returns 2
select plus(1, 'abc')
returns '1abc'
One Line Comment†
CategoryTclTk CategorySoft
CategoryEnglish