Albert221 / FromSelect

MIT License
2 stars 1 forks source link

Determine filtering method #9

Closed Albert221 closed 7 years ago

Albert221 commented 7 years ago

In the sidebar, there is filter input which will filter databases and/or tables on the list. We have to determine the format that will be expected in this input and the expected behavior. There could be many ways of filtering, the most proper I can think of are (brackets mean optional):

  1. string - displays all databases (with tables) whose names consist of string AND all databases that have tables whose names consist of string (with tables whose names consist of that string). string can represent both database's and table's name.
  2. [[string1].]string2 - this format can take three forms: i. database ii. database.table iii. .table

    and displays exactly what users want: (i.) databases whose names consist of string2; (ii.) tables whose names consist of string2 in databases whose names consist of string1; (iii.) tables whose names consist of string2 in any database.

First one is IMO more convenient and more intuitive, but the second one is more precise if one wants to search exactly databases or tables.

I need your opinion @Sobak

Sobak commented 7 years ago

Combine both approaches.

That's my idea

Albert221 commented 7 years ago

Yes, let's add one more thing and that would be it.

What do you mean by exact match? Exact names and not consisting of the phrases?

Sobak commented 7 years ago

"database.table" not *database.table* or with any other placeholders elsewhere

Sobak commented 7 years ago

BTW: good idea for database.

Albert221 commented 7 years ago

Hmmm, IMO that inconsistency is not good. Every syntax looking NOT for exact match but this one looking for exact. What if one wants to search for a table in a big (in terms of tables number) database?

Albert221 commented 7 years ago

I think of a modifier for each of two parts of syntax which would eventually turn strict filtering on, and that would be searching for exact name as the phrase, not LIKE the phrase.

Sobak commented 7 years ago

Overcomplicated, imho. Unless you want to use quotes as a such modifier what is long established practice. This would do the trick

Albert221 commented 7 years ago

OK. In sum, there would be four possible formats for filtering databases, tables and both with one modifier.

If one wants to filter for exact phrases, i.e. for tables consisting of table EXACTLY in database database one will had to use strict modifier which is two quotation marks (") surrounding the part we want to mark for strict search. I.e.:

Albert221 commented 7 years ago

Implemented 1bfe173d17c4fa3e88eff921d881da224e4b1023