neo4j / neo4j-go-driver

Neo4j Bolt Driver for Go
Apache License 2.0
490 stars 69 forks source link

Support for "automatic transaction" management like spring boot #582

Open rullyalves opened 4 months ago

rullyalves commented 4 months ago

I believe it would be interesting to have support for more "automatic" handling of transactions, just writing a transaction manager while creating my application, I would like to know if I can contribute a PR.

example:


// where *T is your possible returned value
txManager := neo4jdb.WithTransaction[T](driver)

_, err := txManager(currentCtx, func(transactionCtx context.Context) (*T, error) {
    // execute your custom service logic in transaction
})
fuad-daoud commented 3 months ago

this would be great