Gilad Weiss f3547e00cc
Inherit clone flag (NewDB) on transaction creation (#5012)
* Inherit clone flag (NewDB) on transaction creation

I find it very reassuring to know that after a finisher API, I get a clean db object for my next queries.
If you look at the example in https://gorm.io/docs i’d see many queries running one after the other.. but in reality they wouldn’t work as the they are portrayed and that’s because in default mode NewDB is false and will make all the clauses stay even after a finisher API.

My solution is just to have the value of the clone flag in the “parent” db object, be injected to its children transactions.

* Fix typo
2022-02-20 08:33:12 +08:00
2022-02-19 17:11:23 +08:00
2022-02-19 17:02:53 +08:00
2022-02-15 20:32:03 +08:00
2022-02-19 23:42:20 +08:00
2022-02-19 17:02:53 +08:00
2022-02-19 23:42:20 +08:00
2022-02-19 17:02:53 +08:00
2022-02-19 17:02:53 +08:00
2021-09-28 22:37:15 +08:00
2021-12-10 17:50:19 +08:00
2021-12-10 17:50:19 +08:00
2022-02-19 17:02:53 +08:00
2015-01-05 08:59:18 +08:00
2020-06-09 12:00:43 +08:00
2021-01-28 10:21:58 +08:00
2022-02-19 17:02:53 +08:00
2022-02-19 17:02:53 +08:00
2022-02-19 17:02:53 +08:00

GORM

The fantastic ORM library for Golang, aims to be developer friendly.

go report card test status Join the chat at https://gitter.im/jinzhu/gorm Open Collective Backer Open Collective Sponsor MIT license Go.Dev reference

Overview

  • Full-Featured ORM
  • Associations (Has One, Has Many, Belongs To, Many To Many, Polymorphism, Single-table inheritance)
  • Hooks (Before/After Create/Save/Update/Delete/Find)
  • Eager loading with Preload, Joins
  • Transactions, Nested Transactions, Save Point, RollbackTo to Saved Point
  • Context, Prepared Statement Mode, DryRun Mode
  • Batch Insert, FindInBatches, Find To Map
  • SQL Builder, Upsert, Locking, Optimizer/Index/Comment Hints, NamedArg, Search/Update/Create with SQL Expr
  • Composite Primary Key
  • Auto Migrations
  • Logger
  • Extendable, flexible plugin API: Database Resolver (Multiple Databases, Read/Write Splitting) / Prometheus…
  • Every feature comes with tests
  • Developer Friendly

Getting Started

Contributing

You can help to deliver a better GORM, check out things you can do

License

© Jinzhu, 2013~time.Now

Released under the MIT License

Description
The fantastic ORM library for Golang, aims to be developer friendly
Readme
Languages
Go 99.9%
Shell 0.1%