Op 9-apr-2011, om 21:29 heeft Roger Binns het volgende geschreven: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > On 04/08/2011 02:40 PM, Edzard Pasma wrote: >> Just found that the APSW shell does tabcomplete (and even for >> tablenames). It is described here: >> >> http://apidoc.apsw.googlecode.com/hg/shell.html > > (I'm the APSW author). It also does output colouring. Makes it a > lot easier > to distinguish numbers from strings of digits etc. I'd also submit > that the > .dump output is a thing of beauty :-) > > It also completes database names, column names, builtin SQLite > function > names, collations, etc(*). However the completion is not context > sensitive > (ie using a grammar) so it is really just completing a sequence of > independent words. This is just fine most of the time and in many > cases > almost any word is allowable at almost any point anyway. I did > look into > trying to hack the grammar (which really is a bunch of grammar rules > interspersed with C code) or using the railroad diagram input in > order to > make a SQLite SQL parser. In the case of completion that is even more > difficult since it would have to tolerate an incomplete string. > Maybe one > day... > > Pragmas are also completed and they are context dependent so if you do > "pragma journal_mode =<TAB>" it will show the journal modes available. > > Unfortunately I do have hard coded tables of many things since it > isn't > possible to find them by asking SQLite at runtime. Some such as > the list of > registered functions and how many arguments they take can only be > provided > by code changes to SQLite itself. It would be nice if there were > virtual > tables allowing dynamic introspection of SQLite. > > (*) In a fit of OCD it even pays attention to what case you are > using and > does completions in the same case even if you mix cases in the same > word! > > Roger > I just made an alias in the shell (Unix-) for this tool:
alias apsw='python -c "import apsw;apsw.main()"' Thats worth it. So far I'd only used the shell programmatically from Python, an other great feature. This was particularly for its dataload capabilities. Also reported an issue that has nothing to do with tabcompletion. The tool does not quit as the SQLite shell does when queries are passed as parameter. The SQLite behaviour is probably more convenient. But anyway I understand that all SQLite examples should work correspondingly. Thanks a lot. _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

