Skip to content

Semicolons should be required regardless of Multiline #250

@shuadoc

Description

@shuadoc

Hello,

First of all, thank you for all your work on this tool :)

It was not immediately apparent to me moving from psql that hitting return would immediately execute the query without a semicolon. Given #175 , it appears that multi-line mode will end with a GO rather than a semicolon. I recommend altering tool behavior to not execute the query unless a semicolon is present.

--- An extended explanation follows ---

The tool behavior as it stands prevents a minor inconvenience (needing to enter a semicolon.) The tool behavior as recommended by this issue prevents potentially destructive accidental usage by novice and expert users alike.

For reference, a simplified example of a recent mistake I made, expecting to be protected by not yet typing a semicolon. When typing the final single quote, the return key was accidentally pressed by the same finger:

update comments set comment = ''
(11639 rows affected)
Time: 0.253s

The query would have been:

update comments set comment = 'something' where id = X;

I ended the string in order to write the WHERE clause so I wouldn't forget and accidentally update every row in the database. Obviously I was horrified that I ended up still updating every row in the database.

For now I can set Multiline to enabled since I now understand the nuances of it's behavior. Unless this issue is accepted, I'll also be leaving it on after issue 175 is completed, and writing GO after each line.

Thanks again!
Josh

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions