如何在蒸气中使用PostgreSQL交易
答
如果您正在使用Fluent(与PostgreSQL的支持蒸气的数据库ORM),那么你只需使用:
drop.database?.transaction { conn in
try modelToSave.makeQuery(conn).save()
try nextModelToSave.makeQuery(conn).save()
}
嗨,我想知道它和“mode.database .transaction?” –
之间的区别该模型还包含对数据库的静态引用。 'Model.database?.transaction'应该与'drop.database?.transaction'完全相同。 – tobygriffin