SQL code completion in the PHP editor

The feature, which I want to introduce today, offers code completion for SQL select statements in the PHP editor. The SQL code completion is offered when the edited string starts with select SQL keyword.

On the first picture you can see that the SQL code completion offers only one item Select Database Connection ... . It's because is not clear which db connection should be used.

When you select the item, a simple dialog for selecting  a database connection is opened. The dialog offers connections, which are already registered in the Services tab or you can create new connection. 

After selecting the connection the SQL code completion offers all tables from selected db connection. 

The code completion offers columns if there known tables that are used in the select statement.  As you can see from the last picture, the code completion is able also to work with table aliases.

The selected database connection is persisted per project. So every project can use different connection. Unfortunately there is missing an UI for changing the connection. But if you want to play with this, you can easily delete the line with auxiliary.org-netbeans-modules-php-editor.dbconn property in nbproject/private/private.properties file. I hope that this will be implemented and will be available in Milestone 2.

The feature wasn't tested properly yet. If you will play with this and run into a bug, please enter it in our Issuezilla.


Comments:

My god, this is genius, I would have never thought about something like this.

Thanks again Petr!

Posted by soso on December 16, 2008 at 01:54 AM CET #

nice

Posted by Tom on December 16, 2008 at 02:20 AM CET #

Simply brilliant !

Posted by Ben on December 16, 2008 at 02:23 AM CET #

WOW ! That is great.
Maybe connection should be selected in project properties or/and saved there ?

Posted by Shadzik on December 16, 2008 at 02:26 AM CET #

whoaa
at last :D
Thanks...keep the good work

Posted by john on December 16, 2008 at 03:03 AM CET #

And competition for UPDATE, DELETE, INSERT INTO, ... will be also?

Posted by gawan on December 16, 2008 at 04:02 AM CET #

to Shadzik: I have enter new defect against the db support - http://www.netbeans.org/issues/show_bug.cgi?id=155605

to Gawan: The feature is not implemented by our (php team). It's a contribution from database team. I have entered new enhancement - http://www.netbeans.org/issues/show_bug.cgi?id=155606

Regards,
Petr

Posted by Petr on December 16, 2008 at 04:03 PM CET #

This are great but I have a simple question: How can I test all this new features?

Posted by Reynier Perez Mira on December 16, 2008 at 04:57 PM CET #

Great.!
Hey, Petr, You give me surprise again.!
And I know every some time, You always give it..
Thanks a lot.!

Posted by guest on December 16, 2008 at 07:12 PM CET #

Bravo!
This is a much anticipated piece of work.
How will you license it?

Regards

Posted by Shlomi Noach on December 16, 2008 at 11:23 PM CET #

To Reynier:
>How can I test all this new features?
Download a development or nightly build and play with the build. You can use also the --userdir switch. More is explain here: http://blogs.sun.com/netbeansphp/entry/userdir . There is also link where you can download the nightly builds.

To Shlomi:
>How will you license it?
It's open source and it has the same license as NetBeans. http://www.netbeans.org/cddl-gplv2.html.

Regards,
Petr

Posted by Petr on December 17, 2008 at 04:09 PM CET #

I am late on this...Wow, another awesome feature added in trunk...

Kudos to Developers :D

Posted by N, Varun on December 18, 2008 at 09:30 AM CET #

This is too good to be true ... :-)

On an unrelated matter, any chance of restoring jMaki - the jMaki Ajax plugin installation attempt fails with:
Warning - could not install some modules: jMaki Ajax support - The module named org.netbeans.modules.editor.deprecated.pre61completion/0 was needed and not found.

All the best and thank you!

Posted by Navid on December 26, 2008 at 12:08 PM CET #

Hi, this function is really great, but i have one idea to improve. I dont know if it's possible but what when you add mysql functions to column select or where select? I think for example functions as NOW(), UNIX_TIMESTAMP(), CONCAT()... Great would be when in list will own created functions too. It's function which was created with CREATE FUNCTION...
It's possible? Or do you have it in plan?

PS: I'm so sorry for my english... :) But i hope that you understand me...

Posted by SendiMyrkr on January 24, 2009 at 02:27 PM CET #

To SendiMyrkr,

it shouldn't be hard to add it. It's not in the current plan and implementing this "just" depends on the resources:).

Regards,
Petr

Posted by Petr on January 25, 2009 at 01:36 PM CET #

Hi,
Excellent work. How long before this is available through IDE updates?

Cheers
Andy

Posted by Andy on January 26, 2009 at 09:38 AM CET #

thanks very nice

Posted by mirc on March 07, 2009 at 03:42 PM CET #

This is too good to be true ... :-)

Posted by muhabbet on March 07, 2009 at 03:43 PM CET #

Hi I'm new of netbeans and I found it great product.
But in the 6.5.1 I did not find this improvement.
What's wrong?
Thank's

Posted by Roberto on March 17, 2009 at 04:46 PM CET #

what improvement?

Posted by bea on March 31, 2009 at 12:27 AM CEST #

Wow, another awesome feature added in trunk...

Posted by chat on April 02, 2009 at 03:38 PM CEST #

Awesome, and exists some tool for Java Editor, where i se the code for this plugin??

Posted by Arturo on April 08, 2009 at 06:47 PM CEST #

NetBeans is a Awesome tool. I am using this for PHP development.
Currently I have installed NetBeans 6.5.1 version and I couldn't find SQL code completion in the PHP editor.
Please let me know how to get this feature.

Posted by Nagendra B.R on April 21, 2009 at 02:53 PM CEST #

> This is too good to be true ... :-)

:)))

is it works in M3?

Posted by alexey_baranov on April 24, 2009 at 04:05 PM CEST #

Thank You

Posted by Emo Resimleri on May 01, 2009 at 11:03 AM CEST #

.

Posted by guest on May 02, 2009 at 10:59 PM CEST #

muy bueno lo de sql!!!, lo probare... Netbeans cada vez esta llegando a la perfeccion ...

Posted by LP on May 13, 2009 at 01:36 PM CEST #

i m new with netbeans, the feathers are realy unbeliveable, and specially the above sql code completion.
Amazeing yarr!!!

Posted by Jawwad Ahmed on June 02, 2009 at 01:42 AM CEST #

thanks

Posted by mırc on June 16, 2009 at 03:16 AM CEST #

thanks you

Posted by mirc on June 16, 2009 at 05:40 AM CEST #

thanks you admin

Posted by mirc indir on June 16, 2009 at 05:41 AM CEST #

very nice post thank you

Posted by Mirc on June 16, 2009 at 07:00 AM CEST #

It's nice, I am learning, thank you

Posted by HD LCD monitor on June 16, 2009 at 09:36 PM CEST #

thanks.

Posted by TV studio film lighting on June 16, 2009 at 09:37 PM CEST #

Thanks a lot. keep it up.

Posted by HD video camera battery on June 18, 2009 at 02:24 AM CEST #

Currently I have installed NetBeans 6.5.1 version and I couldn't find SQL code completion in the PHP editor.
Please let me know how to get this feature.

Posted by rosa on June 18, 2009 at 06:10 AM CEST #

cool, <a href="http://internet-online.org/tv/">online tv</a> and <a href="http://internet-online.org/tv/">watch tv online</a> at <a href="http://internet-online.org/tv/">free online tv</a> site.

Posted by online tv on June 19, 2009 at 12:08 AM CEST #

thanks..

Posted by 乐清网站建设 on June 20, 2009 at 09:56 AM CEST #

thanks nice...

Posted by Aşk Büyüsü on July 01, 2009 at 04:00 AM CEST #

thanks.

Posted by 乐清网站建设 on July 02, 2009 at 10:43 PM CEST #

It's nice, thanks for sharing

Posted by 乐清网站建设 on July 02, 2009 at 10:43 PM CEST #

Hi, this function is really great, but i have one idea<a href="http://www.allistanbultransfer.com" title="istanbul airport transfer,istanbul transfer,ataturk airport transfer" target="_blank">istanbul transfer</a>

<a href="http://www.e-istanbultours.com" title="istanbul tours,istanbul tour,istanbul trips,istanbul sightseeing,istanbul holidays" target="_blank" >istanbul tours</a>

<a href="http://www.istanbul-airport-transfer.com" title="istanbul airport transfer,ataturk airport transfer,istanbul transfer to hotels" target="_blank">ataturk airport transfer</a>
to improve. I dont know if it's possible but what when you add mysql functions to column select or where select? I think for example functions as NOW(), UNIX_TIMESTAMP(), CONCAT()... Great would be when in list will own created functions too. It's function which was created with CREATE FUNCTION...
It's possible? Or do you have it in plan?

Posted by ataturk airport transfer on July 17, 2009 at 04:27 AM CEST #

The selected database connection is persisted per project. So every project can use different connection. Unfortunately there is missing an UI for changing the connection. But if you want to play with this, you
<a href="http://www.istanbul-airport-shuttle.com" title="istanbul airport shuttle,istanbul shuttle service,istanbul shuttlebus" target="_blank" >ataturk airport shuttle</a>

<a href="http://www.istanbul-hotels-transfer.com" title="istanbul transfer to hotels,istanbul airport transfer to hotels,istanbul hotels transfer">ataturk hotels transfer</a>

<a href="http://www.istanbul-hotels-shuttle.com" title="istanbul shuttle to hotels,istanbul airport shuttle to hotels,istanbul hotels shuttle,istanbul shuttlebus to trips">istanbul hotels shuttle</a>

<a href="http://www.privatetransferservice.com" title="istanbul turkish service,istanbul service,private tours in istanbul,istanbul service,istanbul private tour,istanbul private service to taksim">istanbul private transfer service</a>
can easily delete the line with auxiliary.org-netbeans-modules-php-editor.dbconn property in nbproject/private/private.properties file. I hope that this will be implemented and will be available in Milestone 2.

Posted by ataturk airport shuttle on July 17, 2009 at 04:28 AM CEST #

On an unrelated matter, any chance of restoring jMaki - the jMaki Ajax plugin installation attempt fails with:
Warning - could not install some modules: jMaki Ajax support - The module named org.netbeans.modules.editor.deprecated.pre61completion/0 was needed and not found.
<a href="http://www.newistanbulshuttle.com" title="istanbul shuttle,istanbul shuttle bu,istanbul shuttle service" target="_blank">shuttle istanbul</a>

<a href="http://www.istanbul-turkey-hotels.com" title="istanbul hotels,turkey hotels,istanbul turkey hotels" target="_blank">istanbul turkey hotels</a>

<a href="http://www.istanbultransfer.org" title="istanbul airport transfer,istanbul transfer,ataturk airport transfer" target="_blank">istanbul transfer</a>

<a href="http://www.allistanbulshuttle.com" title="istanbul airport shuttle,istanbul shuttle" target="_blank">istanbul shuttle bus</a>

All the best and thank you!

Posted by istanbul shuttle bus on July 17, 2009 at 04:28 AM CEST #

The feature, which I want to introduce today, offers code completion for SQL select statements in the PHP editor. The SQL code completion is offered when the edited string starts with select SQL keyword.
<a href="http://www.newistanbulshuttle.com" title="istanbul airport shuttle,istanbul shuttle" target="_blank">istanbul airport shuttle</a>

<a href="http://www.newistanbultransfer.com" title="istanbul airport transfer,istanbul transfer,ataturk airport transfer" target="_blank">ataturk airport transfer</a>

<a href="http://www.istanbultravelagent.com" title="istanbul travel agent,istanbul travel agency,sultanahmet hotels">sultanahmet hotels</a>

<a href="http://www.azureturizm.com" title="istanbul airport transfer,istanbul transfer,istanbul tours,istanbul hotels,istanbul travel agency">istanbul transfer</a>

On the first picture you can see that the SQL code completion offers only one item Select Database Connection ... . It's because is not clear which db connection should be used.

Posted by istanbul airport shuttle on July 17, 2009 at 04:29 AM CEST #

Thanks..

Posted by mirc sohbet on July 26, 2009 at 09:55 PM CEST #

Very good

Posted by aşk şiirleri on July 26, 2009 at 09:56 PM CEST #

Hmm good works.

Posted by mirc sohbet on July 26, 2009 at 09:56 PM CEST #

Very good.

Posted by mirc on July 26, 2009 at 09:57 PM CEST #

aöf sınav soruları

Posted by aöf on July 27, 2009 at 01:01 AM CEST #

candost is now known as armoking_yesil

Posted by chat on August 06, 2009 at 02:34 PM CEST #

thanks admin...

Posted by mirc on August 18, 2009 at 11:31 AM CEST #

thanks admin..

Posted by türkçe mirc on August 18, 2009 at 11:31 AM CEST #

thanks admin...

Posted by mirc indir on August 18, 2009 at 11:32 AM CEST #

thanks, very infomativ

best regards

Posted by celik kapi on August 21, 2009 at 06:08 PM CEST #

realy very informativ and good. tanks very much

Posted by facebook on August 22, 2009 at 09:44 AM CEST #

Thank you By Admin

Posted by mirc on August 22, 2009 at 09:18 PM CEST #

Thanks for the perfect site :)

Posted by ceyiz on August 24, 2009 at 06:02 PM CEST #

That's awesome, but I have a project that use more thatn one database, it's not commom, but that should not be diffcult to allow, more than one database for project?

The case is that I've a commom db, that several projects use, and a commom db that store commom data, like zip location, user tables, etc.

So my commom query will be like:

SELECT myProject.client.id,commom.legal_entity.company_name FROM myProject.client INNER join commom.legal_entity ON legal_entity.id=client.id_entity WHERE client.id=N;

got it?

So if I can use commom and myProject databases, it would be great. Thanks so far.

Posted by Carlos Blaster on August 25, 2009 at 12:40 PM CEST #

very nice post thank you

Posted by chat on August 26, 2009 at 06:16 PM CEST #

I have installed NetBeans 6.5.1 version and I couldn't find SQL code completion in the PHP editor.
Please let me know how to get this feature.

Posted by how to grow taller on August 27, 2009 at 04:02 PM CEST #

Please let me know how to get this feature as well..

Posted by David on August 28, 2009 at 05:49 AM CEST #

Thanks you let me know netlog !

Posted by netlog on August 28, 2009 at 02:00 PM CEST #

thanks admin site sahibi :P

Posted by mırc on August 29, 2009 at 02:12 PM CEST #

howe are you :)

Posted by mirc yükle on August 29, 2009 at 02:13 PM CEST #

thanks

Posted by mirc on September 02, 2009 at 07:36 AM CEST #

thnks

Posted by kelebek on September 02, 2009 at 07:37 AM CEST #

thanks admin, nice sharing

Posted by seslichat on September 16, 2009 at 05:22 PM CEST #

I thank for the knowledge

Posted by kangal on September 22, 2009 at 11:37 AM CEST #

Genius!
Thanks so much for sharing this.
this will save me lots of headaches

Posted by sports flooring on October 05, 2009 at 07:52 PM CEST #

Brilliant!
Had a few minor hick ups but it is working perfectly!

Posted by kitchen renovation Melbourne on October 05, 2009 at 08:01 PM CEST #

Very nice. Thanks..

Posted by mirc indir on October 10, 2009 at 05:32 PM CEST #

thanks for your great work.

Posted by zbv on October 15, 2009 at 04:36 PM CEST #

I couldn't find SQL code completion in the PHP editor.
Please let me know how to get this feature.

Posted by best registry cleaner on October 20, 2009 at 02:33 PM CEST #

You have to invoke the code completion (CTRL + SPACE) in a string after select. Just like is on the picture. NB 6.8 should also be able to offer the sql cc if the string starts with update.

Posted by Petr Pisl on October 21, 2009 at 05:48 AM CEST #

I have installed NetBeans 6.5.1 version and I couldn't find SQL code completion in the PHP editor.
Please let me know how to get this feature.

Posted by resveratrol supplements on October 26, 2009 at 06:53 AM 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 29, 2009 at 08:05 PM CET #

have installed NetBeans 6.5.1 version and I couldn't find SQL code completion in the PHP editor.
Please let me know how to get this feature.

Posted by fx15 on November 02, 2009 at 03:51 AM CET #

Thanks very good idea of respect for love..

Posted by Dans on November 02, 2009 at 05:18 PM CET #

Nice Sharing Thanks

Posted by cinsel chat on November 03, 2009 at 09:08 AM CET #

thanks for sharing

Posted by sikiş izle on November 25, 2009 at 03:10 PM CET #

nice post 10x

Posted by Alışveriş on November 26, 2009 at 06:02 AM CET #

nice job, thank you :)

Posted by CelikKApi on December 04, 2009 at 01:50 AM CET #

thanks

Posted by mirc on December 10, 2009 at 03:06 PM CET #

Thanks good post nice blog

Posted by Suchmaschinenoptimierung on December 11, 2009 at 01:46 AM CET #

thanks

Posted by Kisiye Özel Hediyeler on December 14, 2009 at 09:25 AM CET #

very useful story i will add this into my blog, well done my friend.

Posted by Tim Wehre on July 30, 2010 at 02:21 AM CEST #

Admire the information published.its really informative and innovative keep us posted with new updates. it was really valuable.

Posted by Grow Taller 4 Idiots on August 12, 2010 at 01:52 AM CEST #

the admin sen bir maLsn :D

Posted by mirc yükle on December 06, 2010 at 05:46 AM CET #

very good idea of respect for love

Posted by rap on December 26, 2010 at 03:57 AM CET #

Post a Comment:
  • HTML Syntax: NOT allowed
About

This blogs is written by NetBeans developers who contribute to the PHP support mainly.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today