[Lazarus] Cross Platform SQL Client/Editor

Michael Van Canneyt michael at freepascal.org
Sun Jan 3 21:39:03 CET 2016



On Sun, 3 Jan 2016, Michael Van Canneyt wrote:

>
>
> On Sun, 3 Jan 2016, Anthony Walter wrote:
>
>> Michael,
>> 
>> Regarding select into, it is needed because many times you select into in
>> order to create a table without needing to define it.
>
> As I said, please create a bug report for this particular case.
>
> As for script execution and executing only the selection, I am working on the 
> solution already.
>

I have committed a solution for execution of selection and execution of
multiple statements (a script).

It's not yet perfect, but works. It uses the SQL script tool.

The execute button now has a dropdown which can be used to enable 1 of 4 modes:
- Execute contents as single statement.
- Execute selection as single statement.
- Execute contents as SQL script statement.
- Execute selection as SQL script statement.

Selection Execution is enabled if the selection contains more than 1 word.

If the execute button is pressed, then a heuristic is used to decide what to
do:
- If there is a valid selection, then selection execution is selected

- If multiple statements are detected (it counts the number of ;
   characters), script execution is selected

No doubt this can be refined.

After each statement, the results are printed in the bottom memo.

If during script execution an error happens, a message is presented with 4
choices:
- Repeat statement
- Continue, stop on next error
- Continue, do not stop on errors
- Abort.

Notably missing: explicit transaction support.

Please test, and suggestions for improvements/changes are welcome.

Michael.




More information about the Lazarus mailing list