diff options
author | drh <drh@noemail.net> | 2018-03-19 19:05:45 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2018-03-19 19:05:45 +0000 |
commit | 8c1eba75a3465c628c59ce95623794b9012b664a (patch) | |
tree | 8e0b6213fc000c983e2514b70cc4b059a3a25b0c /ext/misc/completion.c | |
parent | 9d03f63a7c6be9bb38f2c40b372fdbbd98d2ab9c (diff) | |
download | sqlite-8c1eba75a3465c628c59ce95623794b9012b664a.tar.gz sqlite-8c1eba75a3465c628c59ce95623794b9012b664a.zip |
Enhance the command-line completion extension to return the names of
triggers and views along with the names of tables.
FossilOrigin-Name: 10e32204e1850354ff16fc052145726e903f87185a37f172831dddad1955184e
Diffstat (limited to 'ext/misc/completion.c')
-rw-r--r-- | ext/misc/completion.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/misc/completion.c b/ext/misc/completion.c index 79f889abf..780963515 100644 --- a/ext/misc/completion.c +++ b/ext/misc/completion.c @@ -78,7 +78,7 @@ struct completion_cursor { #define COMPLETION_INDEXES 5 #define COMPLETION_TRIGGERS 6 #define COMPLETION_DATABASES 7 -#define COMPLETION_TABLES 8 +#define COMPLETION_TABLES 8 /* Also VIEWs and TRIGGERs */ #define COMPLETION_COLUMNS 9 #define COMPLETION_MODULES 10 #define COMPLETION_EOF 11 @@ -250,8 +250,7 @@ static int completionNext(sqlite3_vtab_cursor *cur){ const char *zDb = (const char*)sqlite3_column_text(pS2, 1); zSql = sqlite3_mprintf( "%z%s" - "SELECT name FROM \"%w\".sqlite_master" - " WHERE type='table'", + "SELECT name FROM \"%w\".sqlite_master", zSql, zSep, zDb ); if( zSql==0 ) return SQLITE_NOMEM; |