This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Code completion in sql strings doesn't work if the query contains non standard sql commands | ||
---|---|---|---|
Product: | db | Reporter: | paolosca <paolosca> |
Component: | Code | Assignee: | Libor Fischmeistr <lfischmeistr> |
Status: | NEW --- | ||
Severity: | normal | CC: | tmysik |
Priority: | P3 | ||
Version: | 7.1 | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
paolosca
2011-10-22 17:34:38 UTC
Editor area. Or maybe databases? Please evaluate. Thanks. It's not so simple. There is a method, in the PHP part of implementation, which checks possible SQL statements. It's considered by the start of a string. If the string, where the CC is invoked, starts with "select, insert, update, delete, or drop", it's considered as "possible sql statement". But I can't simply add "set" as another keyword, because it is not supported by DB infrastracture too :) So I have to extract the exact statement, where the carret is, trim it out of that whole string (where are another statements too) and pass it to the DB infrastructure for CC... You can simply workaround it by dividing SQL statements into separate strings. I was trying to find a workaround for this and I noticed that the database code completion doesn't work even if the "set" line is commented as in the following example: $query = " -- set DATESTYLE to 'Postgres,European'; select * from "; Yes, it can't. It works only with insert, update, delete, select, drop at the start of the string. And yes, it's hardcoded there...no evaluation about comments is used, it simply checks String.startsWith() at the whole string. It's really dummy implementation :) I think that the "SET" command should be supported by NetBeans DB support at first. |