Skip to content

Export DbMap within Transaction #35

@tonyhb

Description

@tonyhb

I'd love to be able to mix basic CRUD queries with Modl with more advanced, raw sqlx queries.

The one thing holding this back is assimilating a *sqlx.Tx within Modl like this:

func ORMTx(tx *sql.Tx) *modl.Transaction {
    // where dbMap is a previously initialised *model.DbMap
    return &modl.Transaction{dbMap, tx}
}

Doing this would let you chain sqlx.Tx raw queries alongside Modl queries:

tx := sqlx.MustBegin()
SomethingWithSQL(tx)
SomethingWithORM(tx)
tx.Commit()

Or is mixing the two crazy?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions