sqlx icon indicating copy to clipboard operation
sqlx copied to clipboard

feat(postgres): allow running multiple statements in no tx migrations

Open adriangb opened this issue 1 year ago • 4 comments

Closes #3693

adriangb avatar Jan 19 '25 04:01 adriangb

I also don't see much benefit in namespacing the annotations. I don't see much harm, but I also don't see much benefit.

My argument to add namespacing was mostly about making it clearer to the user that the annotation is in-fact an annotation. (-- no-transaction might get confused with a regular comment, -- sqlx:no-transaction definitely NOT.)

Also it implicitly communicates that the annotation comes from sqlx, which makes it easier to find out why it is there and what it does.

The last point is that I am reluctant about whitespaces in user interfaces, because they are far too easy to screw up and might lead to hard to diagnose errors.

Like when writing an annotation a user might accidentally add an tab character instead of space, or have two spaces instead of one. That is especially the case when dealing with a system that has relatively little insight into what is happening as this.

Since the existing annotation isn't namespaced, adding a namespaced annotation (as well as using a different comment style) would just be confusing to the user.

But yeah. In the end all those points don't have too much impact and just a few things I tend to be cautious of.

titaniumtraveler avatar Jan 19 '25 17:01 titaniumtraveler

@abonander any other changes other than renaming and matching the full line?

Do you generally think this implementation is more viable?

adriangb avatar Jan 19 '25 18:01 adriangb

@abonander I've renamed as per your request and made it only match a full line, including adding a test for the latter

adriangb avatar Jan 20 '25 13:01 adriangb

@adriangb do you have plans to come back to this?

abonander avatar Feb 20 '25 21:02 abonander