Open vladfaust opened 5 years ago
how about:
Onyx::SQL.transaction do |tx|
tx.query(...)
end
tx wouldn't be a DB::Transaction
in this case but rather the duplicated repo
with db set to the DB::Transaction
. This way it would mask the internals from
the API users and it'd be quite intuitive to use.
Is this Onyx::SQL.transaction
method currently implemented? I didn't find anything in the onyx-sql repo
@repomaa the definition is here: https://github.com/onyxframework/onyx/blob/9402f0a81bf911818300bcf35bdfc0b652837420/src/onyx/sql.cr#L47
hm, any reason why it isn't defined in the Onyx::SQL repo?
@repomaa yes, because onyx/onyx is a higher-level framework, and onyx/sql is an ORM
Proposed API: