SQL code completion improved
Today, I would like to show you some improvements done in SQL code completion area (thanks to our colleagues from database team!).
As you probably know, there is already SQL code completion in PHP editor available - but only for SELECT statement. But this has changed recently, now you can enjoy this great feature for INSERT, UPDATE and DELETE statements as well (please note that code completion works for other SQL keywords as well, but not for the first statement in the string - you have to type INSERT/UPDATE/DELETE yourself).
Let's have a look at some screenshots, first for INSERT statement:



Code completion for UPDATE statement works very similarly:



Last, but not leaset, the DELETE statement:


That's all for today, as always, please test it and report all the issues or enhancements you find in NetBeans IssueZilla (component php, subcomponent editor).

Wow, great feature. I will check it out.
However, I haven't used it in practice yet. We utilize an XPath-style query-generator. Just like this:
$db->insert("Animal.*", array("ANIMALNAME" => "dog));
// sends: Insert into Animal(animalname) VALUES ('dog')
or even:
$address = $db->select("Animal.dog.customer.address");
// sends: SELECT CustomerData.address from Animal inner join CustomerData on CustomerData.id = Animal.customer where Animal.id = 'dog'
(where Animal.customer is a foreign-key to CustomerData.id)
I appreciate the feature, even though we currently just use it to browse the database.
However: I would really like to export the reverse-engineered database structure in NetBeans to a XML document. That would be great!
This info could be converted via XSLT to just about every format and we (and possibly other users) could use it as input to feed our applications and code-generators with structure information.
Just think of it for a while: you could use it to implement Rapid-Prototyping as a NetBeans-extension. Wouldn't that be cool as well - what you think?
Posted by Tom on October 29, 2009 at 05:14 PM CET #
To Tom:
First, thanks for your feedback!
What you want is not task for PHP team, please, submit an enhancement for Databases (URL can be found in the blog post). Thanks.
Posted by Tomas Mysik on October 30, 2009 at 11:28 AM CET #
Thank you - I will add an issue :-)
Posted by Tom on October 30, 2009 at 06:10 PM CET #
It was a very nice idea! Just wanna say thank you for the information you have shared. Just continue writing this kind of post. I will be your loyal reader. Thanks again.
Posted by links of london on October 31, 2009 at 03:35 AM CET #
When I download the latest test builds, do I extract the zip file in my current netbeans directory?
Posted by llonden on October 31, 2009 at 05:30 PM CET #
To llonden:
Usually, it is better to start with an empty directory.
Posted by Tomas Mysik on November 02, 2009 at 11:31 AM CET #
I'm using NetBeans 6.8B. How I can use this new improvements at PHP plugin? How I'll proceed to install it? Where to download the latest build nigthly?
Posted by ReynierPM on November 03, 2009 at 02:37 PM CET #
@ReynierPM
Interesting point. Maybe someone could make a webcast / video-tutorial? It's not that difficult at all.
If you don't already have software for this, I suggest the free "Wink" (http://www.debugmode.com/wink) for video tutorials (Windows and Linux). It supports text comments (so you don't need a mic) and may export recorded video to Shockwave files.
Recording a tutorial is easy: just hit the record button, do whatever you would have done anyway. Stop recording, optionally add comments and export your video as SWF. That's all. 10-30 minutes top.
Posted by Tom on November 04, 2009 at 10:43 AM CET #
@ReynierPM
Oh, hold on a sec. - I just found this screen-cast plus related articles (dating to Aug 2009). Maybe this might be just what you were looking for:
http://blogs.sun.com/netbeansphp/entry/screencast_declaring_variables_in_comment
Posted by Tom on November 04, 2009 at 12:15 PM CET #
To ReynierPM:
The link is in the blog post, as always (search for "test it").
Posted by Tomas Mysik on November 05, 2009 at 09:53 AM CET #