X

An Oracle blog about NetBeans for PHP

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.


Join the discussion

Comments ( 90 )
  • soso Tuesday, December 16, 2008

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

    Thanks again Petr!


  • Tom Tuesday, December 16, 2008

    nice


  • Ben Tuesday, December 16, 2008

    Simply brilliant !


  • Shadzik Tuesday, December 16, 2008

    WOW ! That is great.

    Maybe connection should be selected in project properties or/and saved there ?


  • john Tuesday, December 16, 2008

    whoaa

    at last :D

    Thanks...keep the good work


  • gawan Tuesday, December 16, 2008

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


  • Petr Tuesday, December 16, 2008

    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


  • Reynier Perez Mira Tuesday, December 16, 2008

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


  • guest Tuesday, December 16, 2008

    Great.!

    Hey, Petr, You give me surprise again.!

    And I know every some time, You always give it..

    Thanks a lot.!


  • Shlomi Noach Tuesday, December 16, 2008

    Bravo!

    This is a much anticipated piece of work.

    How will you license it?

    Regards


  • Petr Wednesday, December 17, 2008

    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


  • N, Varun Thursday, December 18, 2008

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

    Kudos to Developers :D


  • Navid Friday, December 26, 2008

    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!


  • SendiMyrkr Saturday, January 24, 2009

    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...


  • Petr Sunday, January 25, 2009

    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


  • Andy Monday, January 26, 2009

    Hi,

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

    Cheers

    Andy


  • mirc Saturday, March 7, 2009

    thanks very nice


  • muhabbet Saturday, March 7, 2009

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


  • Roberto Tuesday, March 17, 2009

    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


  • bea Monday, March 30, 2009

    what improvement?


  • chat Thursday, April 2, 2009

    Wow, another awesome feature added in trunk...


  • Arturo Wednesday, April 8, 2009

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


  • Nagendra B.R Tuesday, April 21, 2009

    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.


  • alexey_baranov Friday, April 24, 2009

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

    :)))

    is it works in M3?


  • Emo Resimleri Friday, May 1, 2009

    Thank You


  • guest Saturday, May 2, 2009

    .


  • LP Wednesday, May 13, 2009

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


  • Jawwad Ahmed Monday, June 1, 2009

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

    Amazeing yarr!!!


  • mırc Tuesday, June 16, 2009

    thanks


  • mirc Tuesday, June 16, 2009

    thanks you


  • mirc indir Tuesday, June 16, 2009

    thanks you admin


  • Mirc Tuesday, June 16, 2009

    very nice post thank you


  • HD LCD monitor Tuesday, June 16, 2009

    It's nice, I am learning, thank you


  • TV studio film lighting Tuesday, June 16, 2009

    thanks.


  • HD video camera battery Thursday, June 18, 2009

    Thanks a lot. keep it up.


  • rosa Thursday, June 18, 2009

    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.


  • online tv Thursday, June 18, 2009

    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.


  • &#20048;&#28165;&#32593;&#31449;&#24314;&#35774; Saturday, June 20, 2009

    thanks..


  • A&#351;k B&uuml;y&uuml;s&uuml; Wednesday, July 1, 2009

    thanks nice...


  • &#20048;&#28165;&#32593;&#31449;&#24314;&#35774; Thursday, July 2, 2009

    thanks.


  • &#20048;&#28165;&#32593;&#31449;&#24314;&#35774; Thursday, July 2, 2009

    It's nice, thanks for sharing


  • ataturk airport transfer Friday, July 17, 2009

    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?


  • ataturk airport shuttle Friday, July 17, 2009

    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.


  • istanbul shuttle bus Friday, July 17, 2009

    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!


  • istanbul airport shuttle Friday, July 17, 2009

    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.


  • mirc sohbet Sunday, July 26, 2009

    Thanks..


  • a&#351;k &#351;iirleri Sunday, July 26, 2009

    Very good


  • mirc sohbet Sunday, July 26, 2009

    Hmm good works.


  • mirc Sunday, July 26, 2009

    Very good.


  • a&ouml;f Sunday, July 26, 2009

    aöf sınav soruları


  • chat Thursday, August 6, 2009

    candost is now known as armoking_yesil


  • mirc Tuesday, August 18, 2009

    thanks admin...


  • t&uuml;rk&ccedil;e mirc Tuesday, August 18, 2009

    thanks admin..


  • mirc indir Tuesday, August 18, 2009

    thanks admin...


  • celik kapi Friday, August 21, 2009

    thanks, very infomativ

    best regards


  • facebook Saturday, August 22, 2009

    realy very informativ and good. tanks very much


  • mirc Saturday, August 22, 2009

    Thank you By Admin


  • ceyiz Monday, August 24, 2009

    Thanks for the perfect site :)


  • Carlos Blaster Tuesday, August 25, 2009

    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.


  • chat Wednesday, August 26, 2009

    very nice post thank you


  • how to grow taller Thursday, August 27, 2009

    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.


  • David Friday, August 28, 2009

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


  • netlog Friday, August 28, 2009

    Thanks you let me know netlog !


  • m&#305;rc Saturday, August 29, 2009

    thanks admin site sahibi :P


  • mirc y&uuml;kle Saturday, August 29, 2009

    howe are you :)


  • mirc Wednesday, September 2, 2009

    thanks


  • kelebek Wednesday, September 2, 2009

    thnks


  • seslichat Wednesday, September 16, 2009

    thanks admin, nice sharing


  • kangal Tuesday, September 22, 2009

    I thank for the knowledge


  • sports flooring Monday, October 5, 2009

    Genius!

    Thanks so much for sharing this.

    this will save me lots of headaches


  • kitchen renovation Melbourne Monday, October 5, 2009

    Brilliant!

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


  • mirc indir Saturday, October 10, 2009

    Very nice. Thanks..


  • zbv Thursday, October 15, 2009

    thanks for your great work.


  • best registry cleaner Tuesday, October 20, 2009

    I couldn't find SQL code completion in the PHP editor.

    Please let me know how to get this feature.


  • Petr Pisl Wednesday, October 21, 2009

    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.


  • resveratrol supplements Monday, October 26, 2009

    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.


  • links of london Thursday, October 29, 2009

    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.


  • fx15 Monday, November 2, 2009

    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.


  • Dans Monday, November 2, 2009

    Thanks very good idea of respect for love..


  • cinsel chat Tuesday, November 3, 2009

    Nice Sharing Thanks


  • siki&#351; izle Wednesday, November 25, 2009

    thanks for sharing


  • Al&#305;&#351;veri&#351; Thursday, November 26, 2009

    nice post 10x


  • CelikKApi Friday, December 4, 2009

    nice job, thank you :)


  • mirc Thursday, December 10, 2009

    thanks


  • Suchmaschinenoptimierung Friday, December 11, 2009

    Thanks good post nice blog


  • Kisiye &Ouml;zel Hediyeler Monday, December 14, 2009

    thanks


  • Tim Wehre Friday, July 30, 2010

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


  • Grow Taller 4 Idiots Wednesday, August 11, 2010

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


  • mirc y&uuml;kle Monday, December 6, 2010

    the admin sen bir maLsn :D


  • rap Sunday, December 26, 2010

    very good idea of respect for love


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.