We are introducing SQL commands to support MongoDB. Auto Complete needs to be enhanced to handle new SQL syntax.
1. DELETE [ALL|ONE] FROM collection_name [WHERE condition]
When typing "DELETE ONE FROM", auto complete brings up a list of collection names (which is correct). Choose a collection and then type "WHERE". Auto complete still brings up a list of collection names; it should be a list of field names for the collection.
"DELETE FROM" works, but not "DELETE ONE FROM" or "DELETE ALL FROM". See attached screenshots "DELETE.png" and "DELETE ONE.png".
2. UPDATE [ALL|ONE] collection_name SET field_name1=value1[, field_name2=value2 …] WHERE condition
When typing "UPDATE ONE", auto complete doesn't bring up a list of collection names. After typing in the collection name and then "WHERE", auto complete doesn't bring up a list of field names.
3. REPLACE INTO collection_name VALUE (json_document) WHERE condition
After "WHERE", auto complete brings up a list of collection names; it should be a list of field names.
4. CREATE COLLECTION collection_name
and DROP COLLECTION collection_name
After typing "CREATE COLLECTION", auto complete brings up a list of collection names. When typing "CREATE TABLE" for a MySQL connection, auto complete doesn't bring up a list of table names.
After typing "DROP COLLECTION", auto complete brings up a list of collection names (which is good). However, for a MySQL connection, "DROP TABLE" doesn't bring up a list of table names. In this case, we may want to enhance DROP TABLE.
5. In MongoDB, you can have subfields. For example, you have a field named "manager" with subfields "first" and "last". The subfields are "manager.first" and "manager.last". When entering a field name, auto complete brings up a list of field names:
manager
manager.first
manager.last
As you continue to type "manager", the list of fields stay, but as soon as you type ".", the list disappears.
|
91 KB
|
75 KB
Kin-Hong, we would like to know how much effort it will take to support the new syntax before deciding whether we want these enhancements in 14.0.
New syntax 1 through 4 are relatively straight forward, should take about 1 day to add/implement. However, full regression tests on autocomplete will be required.
5. is outside the scope of SqlParser, and looks like a bug or misconfiguration with the current Netbeans editor autocomplete popup. The same behavior exists for relational databases. For example, add "manager.first" and "manager.last" columns to a MySql database table, the Netbeans autocomplete popup will disappear after "manager.".
New syntax 1 through 4 are relatively straight forward, should take about 1 day to add/implement. However, full regression tests on autocomplete will be required.
5. is outside the scope of SqlParser, and looks like a bug or misconfiguration with the current Netbeans editor autocomplete popup. The same behavior exists for relational databases. For example, add "manager.first" and "manager.last" columns to a MySql database table, the Netbeans autocomplete popup will disappear after "manager.".
Regarding #5, the problem seems to be that SQLStdCompletionQuery.queryCompletionOnType returns null for a column with a dot inside. I have no access to the current code for this so you'll have to investigate further.
Regarding #5, the problem seems to be that SQLStdCompletionQuery.queryCompletionOnType returns null for a column with a dot inside. I have no access to the current code for this so you'll have to investigate further.
I have fixed issues 1 to 4. For 5, when "manager." is typed, SQLStdCompletionQuery.queryCompletionOnType() treats "manager" as the schema. Since there is no "manager" schema, there is no table name completion suggestions. To fix this will require a major rewrite of SQLStdCompletionQuery.queryCompletionOnType().
I have fixed issues 1 to 4. For 5, when "manager." is typed, SQLStdCompletionQuery.queryCompletionOnType() treats "manager" as the schema. Since there is no "manager" schema, there is no table name completion suggestions. To fix this will require a major rewrite of SQLStdCompletionQuery.queryCompletionOnType().
I am going to mark this as resolved. Please create new issues if necessary.
I am going to mark this as resolved. Please create new issues if necessary.
Issue #8202 |
Closed |
Fixed |
Resolved |
Completion |
No due date |
No fixed build |
No time estimate |
1 issue link |
breaks #12687
Issue #12687Server Registration->Permissions for DDL on drops of temp table on Sybase not working |
Kin-Hong, we would like to know how much effort it will take to support the new syntax before deciding whether we want these enhancements in 14.0.