Monday Aug 10, 2009

Screencast: Declaring Variables in Comment and Code Completion for Constructors and SQL Queries

A screencast is now available showing how to declare variables in comments, constructor code completion, and SQL code completion. The screencast is hosted on mediacast.sun.com.[Read More]

Tuesday Dec 16, 2008

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.


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