You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Having a simple Swift API to run multiple sql statements/actions in a transaction would be nice. I write micro services that interact with MySQL without any user requests and sending raw commands isn’t great.
Describe the solution you'd like
Something in the line of
Easiest option if you want a pure-SQLKit API is to just adapt the implementation provided by FluentMySQLDriver to SQLKit. This was not previously possible directly, as the withSession() API was added to SQLKit quite recently. Be warned that this example does NOT guard against nested transactions the way the Fluent API does, and will crash if invoked on an SQLDatabase that is not ultimately backed by a MySQLConnection:
Of course, if you're able to import FluentKit and just want to use SQLKit, it's even simpler to just downcast an SQLDatabase to any Database, call transaction(_:) on that, and upcast the closure parameter back to any SQLDatabase.
Is your feature request related to a problem? Please describe.
Having a simple Swift API to run multiple sql statements/actions in a transaction would be nice. I write micro services that interact with MySQL without any user requests and sending raw commands isn’t great.
Describe the solution you'd like
Something in the line of
would be nice.
The text was updated successfully, but these errors were encountered: