Chore: Add initial/experimental xorm spanner driver (#101398)

* make it build and start

* run some migrations

* add build tags, remove log

* remove unused code

* revert go.mod changes

* move initialisation into dialect file

* update workspace

* update workspace once again

* clean up dependencies

* further cleanup

* Address some review feedback.

* Fix go.sum.

---------

Co-authored-by: Peter Štibraný <pstibrany@gmail.com>
This commit is contained in:
Serge Zaitsev
2025-03-03 17:02:10 +01:00
committed by GitHub
co-authored by Peter Štibraný
parent 4bab25054f
commit 165bca6417
32 changed files with 5144 additions and 224 deletions
@@ -400,6 +400,11 @@ func (mg *Migrator) InTransaction(callback dbTransactionFunc) error {
sess := mg.DBEngine.NewSession()
defer sess.Close()
// XXX: Spanner cannot execute DDL statements in transactions
if mg.Dialect.DriverName() == Spanner {
return callback(sess)
}
if err := sess.Begin(); err != nil {
return err
}