Closed Preetam closed 2 years ago
Oh, is it because there is no connection pooling so everything's happening in the same connection?
Yes. Since it is a single connection it will be correctly executed even though the code does look suspicious. That code could be made clearer. But I'm also hoping to eliminate explicit transaction handling altogether. See #43.
Thanks!
Reading the code for migration, it looks like a transaction is started here:
https://github.com/jackc/tern/blob/ebefbe44196db4180c0ce4ef4244e95d01dc48a8/migrate/migrate.go#L339
but
tx
is not actually used to execute the SQL, so the migration is not actually run within a transaction.https://github.com/jackc/tern/blob/ebefbe44196db4180c0ce4ef4244e95d01dc48a8/migrate/migrate.go#L352
@jackc: Am I reading that wrong or is there a bug here?