Douglas Danger Manley 72d0fa6196 Fix Statement Where clone array corruption in v2
Method-chaining in gorm is predicated on a `Clause`'s `MergeClause`
method ensuring that the two clauses are disconnected in terms of
pointers (at least in the Wherec case).

However, the original Where implementation used `append`, which
only returns a new instance if the backing array needs to be resized.
In some cases, this is true.  Practically, go doubles the size of the
slice once it gets full, so the following slice `append` calls would
result in a new slice:

* 0 -> 1
* 1 -> 2
* 2 -> 4
* 4 -> 8
* and so on.

So, when the number of "where" conditions was 0, 1, 2, or 4, method-chaining
would work as expected.  However, when it was 3, 5, 6, or 7, modifying the
copy would modify the original.

This also updates the "order by", "group by" and "set" clauses.
2020-06-07 16:54:01 -04:00
2020-06-07 13:16:09 +08:00
2020-06-07 15:26:43 +08:00
2020-06-02 09:25:55 +08:00
2020-06-06 10:47:32 +08:00
2020-06-07 22:03:45 +08:00
2020-06-07 18:37:05 +08:00
2020-06-02 09:18:01 +08:00
2020-06-07 15:26:43 +08:00
2020-06-05 19:19:12 +08:00
2020-06-05 19:19:12 +08:00
2020-06-07 22:03:45 +08:00
2020-06-02 10:50:38 +08:00
2020-06-06 14:28:59 +08:00
2020-06-05 11:40:24 +08:00
2015-01-05 08:59:18 +08:00
2020-05-31 10:24:49 +08:00
2020-05-29 07:35:45 +08:00
2020-06-05 11:40:24 +08:00
2020-06-06 15:05:24 +08:00
2020-06-02 09:18:01 +08:00
2020-06-06 22:52:08 +08:00
2020-06-06 15:05:24 +08:00

GORM

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

go report card wercker status codecov Join the chat at https://gitter.im/jinzhu/gorm Open Collective Backer Open Collective Sponsor MIT license GoDoc

Overview

  • Full-Featured ORM (almost)
  • Associations (Has One, Has Many, Belongs To, Many To Many, Polymorphism)
  • Hooks (Before/After Create/Save/Update/Delete/Find)
  • Preloading (eager loading)
  • Transactions
  • Composite Primary Key
  • SQL Builder
  • Auto Migrations
  • Logger
  • Extendable, write Plugins based on GORM callbacks
  • 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%