Chapter 2
Introduction to new version

2.1 Reasons for new version

The version 1 of the gaSQLParser is still in alpha phase, and I already want to start to develop new version! Why so?

Well, there is only one main reason: I feel that the current structure of the component is not the one it should be. It has somehow became a ”legacy” code, something I would never write again. The structure of component was designed to be flexible, but it is not enough. Also, the component is too ”heavy”, so it is somehow hard to get things working correctly...

So, I decided to start a new version. I hope I would be able to overcome following problems:

  1. Dialect support. I have been thinking about this, but I have not found a good way for dialect support in current structure. When making a new version, I will be thinking about the issue right in the start.
  2. State maintaining. In the current release, it is most tainting to maintain the correct state for objects. Specially if the parse must be ”rewinded”, for example in case when the first-chance assumption about the current element type is incorrect. (switching from field parse to expression parse is one example).
  3. The internal structure for data storage. In the time I started writing the component, I didn’t find a better way to store the data... I hope that the new structure will relax the requirements for the storage, so that i would be able to use some standard storage class (TList for example).
  4. Statement changing issues. As in current situation, it is quite challenging to keep the xxx.SetAsString methods correctly working, actually, to make them inject the contest to the right place in the SQL.

As much as I have thought, those requirements would make the new interface of the new component largely incompatible with the old one. Thats the reason why I decided to go for version 2.

There are also some things that won’t change:

  1. You will still be able to parse the SQL statement. Only the code to do that would be slightly different.
  2. You will still be able to inspect and modify the SQL statement, and reformat it. But again, the code will need to be rewritten...

Well, let’s hope that the new version will be better than old one...