mycli icon indicating copy to clipboard operation
mycli copied to clipboard

Code Snippets

Open brewneaux opened this issue 11 years ago • 4 comments

Would be really neat, in the same way that we have favorited queries, to have code snippets of a sort. Say you have a table whose name is "this_is_a_really_longandhardto_remember_tablename" - instead of typing it everything, you could just do something like thatlongtable, hit tab, and have it autofill.

brewneaux avatar Aug 03 '15 16:08 brewneaux

That's where the fuzzy matching comes in handy. You can start typing parts of a long table name and it'll narrow them down for you.

For eg:

"this_is_a_really_longandhardto_remember_tablename"

Can be narrowed down by typing:

"trelorta"

Which are all characters in that table name in the right order.

amjith avatar Aug 03 '15 17:08 amjith

Oh wow. I didn't realize it was THAT fuzzy. Closing.

brewneaux avatar Aug 03 '15 18:08 brewneaux

When someone first requested it #46, I thought it would be mountains of coding. But it was 10 lines of code.

Here's a description of the algorithm that was used. http://blog.amjith.com/fuzzyfinder-in-10-lines-of-python

amjith avatar Aug 03 '15 18:08 amjith

Not sure if I should create a new issue, I'll just post here for now.

This would be neat for other cases like the following:

type select press tab then it expands into:

SELECT _ FROM _

And then you would be able to write columns and table name. I used mycli a lot and it gets very repetitive to type some common queries. > I know about fav queries though

Herz3h avatar Sep 18 '20 14:09 Herz3h