mycli icon indicating copy to clipboard operation
mycli copied to clipboard

Missing AutoComplete with create table ... like

Open Ozzyboshi opened this issue 9 years ago • 3 comments

When copying a MYSQL table i use the following syntax

create TABLE tabledest LIKE tablesource

this command creates a new table called tabledest based on the tablesource structure It would be good if mycli offers AutoComplete suggestions searching the tables after the LIKE keyword right now the suggestions are only : ACCESS, ADD, ALL, ALTER TABLE, AND, ANY and AS

Reported using mycli 0.1.0 on ubuntu 14.04.2 LTS

What do you think?

Ozzyboshi avatar Jun 05 '15 08:06 Ozzyboshi

Yup. That's a fair request. I'll see if I can add that in.

amjith avatar Jun 07 '15 02:06 amjith

If you're going to work on LIKE autocompletion, consider

CREATE TABLE foo LIKE <autocomplete>

Here I would expect to see a list of tables.

SELECT * FROM foo WHERE bar LIKE <autocomplete>

Here I would expect to see a list of functions (for string manipulation), or even fields.

I suppose you might be able to create a condition based off the first command that determines what is shown. However, that wouldn't work in a CREATE TABLE ... SELECT scenario

CREATE TABLE foo (bar INT) SELECT biz FROM baz WHERE biz LIKE <autocomplete>

I would expect functions/fields, not tables.

steverobbins avatar Jun 07 '15 05:06 steverobbins

Yeah, it's not going to be easy, but I believe it is possible. I'll give it a shot. :)

amjith avatar Jun 08 '15 17:06 amjith