Friday, September 21, 2007

Quoting SQL - begone!

We recently put in a few changes to the database support for NetBeans that I thought you might like to know about.

A very common complaint has been the fact that NetBeans quotes everything when it comes to SQL. When you use the Database Explorer to create a table, index, view, etc., it quotes all the identifiers.

This may or may not be an issue. If, for example, you use all upper case for your identifiers, and the database you are using follows the standard and auto-upper-cases all identifiers, then if you write SQL without quoting, things will work. But how many of us bother to consistently upper-case things?

Here's what can happen to you in NetBeans 5.5:

NB55-Create-Table.jpg

Broken-Select.jpg

Well, as of Beta 1, we don't do that any more. We do not quote identifiers when creating SQL objects. If you want them quoted, you can do so when you type in the identifier in the wizard. So now you get the right behavior:

NB6-create-table.jpg

NB6-select-table.jpg

When Beta 2 comes out, we have also made it so that when we generate SQL for you (for instance, when you choose "View Data" on a table, or when you us the visual query editor), we only quote when needed, whereas before we quoted every identifier, whether it was needed or not, misleading users to think they also needed to quote everything, and making the SQL difficult to read.

So, for all of you who have been complaining to me and others on our team about this: you're welcome. Chocolates are always appreciated :)

3 comments:

dgurba said...

oh gee thanks!

I have a side-project (for my dad) using JavaDB. I was using NetBeans and its DB tools to manage it (a few months ago ... its a semi stagnant project), and this "feature" was really bugging me. I'd create a table and then try to access it and get errors in my SQL that I thought shouldn't be there.

I have since then switched to SQuirreL SQL Client for my JavaDB schema creation and migration scripts. For me it feels more robust and quite a bit more user friendly at the moment ... things might have changed?

I do quite a bit of db work typically using either myphpadmin or squirrel. Should I re-look at the integrated netbeans db tools soon/now?

David Van Couvering said...

Hi, dgurba. I think you should look at it *soon*. For NB 6, I was still getting up to speed and the rest of the team was primarily focused on integrating visualweb into NetBeans.

In the next release, we're planning to focus on improving the DB experience in NetBeans. Here your in put is *very* important. What should we focus on? What annoyances made you move away, what do you like about Squirrel that you'd like to see in NetBeans? Here's your chance to influence us. Later on we'll have made our decisions and it will be hard to change course...

dgurba said...

can you please send me an email address to respond to your request for information? I have a response ready ... but its rather wordy :)

I can be reached at me@davidgurba.com