usql
usql copied to clipboard
Autocomplete for DDL commands
Implement autocomplete for DDL commands like CREATE
, ALTER
, and DROP
.
It is okay to see the implementation on #286 to create autocomplete for ALTER
and DROP
@nineinchnick ?
@rubiagatra PRs are always welcome! Using the PR you mentioned as an example, one could attempt to translate more parts of https://github.com/postgres/postgres/blob/master/src/bin/psql/tab-complete.c#L1740 from C to Go.
hi @nineinchnick just want ask some questions. I recently create #428 Do you want to complete CREATE
first?
e.g
in psql
postgres=# CREATE
ACCESS METHOD DATABASE FOREIGN TABLE MATERIALIZED VIEW PUBLICATION SERVER TEMP TYPE VIEW
AGGREGATE DOMAIN FUNCTION OPERATOR ROLE STATISTICS TEMPORARY UNIQUE
CAST EVENT TRIGGER GROUP OR REPLACE RULE SUBSCRIPTION TEXT SEARCH UNLOGGED
COLLATION EXTENSION INDEX POLICY SCHEMA TABLE TRANSFORM USER
CONVERSION FOREIGN DATA WRAPPER LANGUAGE PROCEDURE SEQUENCE TABLESPACE TRIGGER USER MAPPING FOR
currently in usql
pg:postgres@localhost/test=> CREATE
DATABASE SCHEMA SEQUENCE TABLE VIEW TEMPORARY
usql
works with many more SQL dialects than just PostgreSQL. It's easy to add all the keywords from psql
to the autocompleter, but I haven't done that yet because they might be invalid in some databases and right now we only have one generic completer. Most of them are also rarely used.
I think ALTER
statements might be more useful, and are also pretty common.