v2.0 - 2020.08
GORM 2.0 a été réécrit de zéro, introduisant des changements majeurs de l’API et de nombreuses améliorations
- Amélioration des performances
- Modularité
- Context, Batch Insert, Prepared Statement Mode, DryRun Mode, Join Preload, Find To Map, Create From Map, FindInBatches supports
- Nested Transaction/SavePoint/RollbackTo SavePoint supports
- Named Argument, Group Conditions, Upsert, Locking, Optimizer/Index/Comment Hints supports, SubQuery improvements
- Full self-reference relationships supports, Join Table improvements, Association Mode for batch data
- Multiple fields support for tracking create/update time, which adds support for UNIX (milli/nano) seconds
- Field permissions support: read-only, write-only, create-only, update-only, ignored
- New plugin system: multiple databases, read/write splitting support with plugin Database Resolver, prometheus integrations…
- New Hooks API: unified interface with plugins
- New Migrator: allows to create database foreign keys for relationships, constraints/checker support, enhanced index support
- New Logger: context support, improved extensibility
- Unified Naming strategy: table name, field name, join table name, foreign key, checker, index name rules
- Meilleure prise en charge de type de données personnalisé (par ex. JSON)
v1.0 - 2016.04
Modifications importantes :
gorm.Open
retourne*gorm.DB
au lieu degorm.DB
- La mise à jour ne met à jour que les champs modifiés
- Le Soft Delete vérifie seulement
deleted_at IS NULL
- New ToDBName logic Common initialisms from golint like
HTTP
,URI
was converted to lowercase, soHTTP
‘s db name ishttp
, but noth_t_t_p
, but for some other initialisms not in the list, likeSKU
, it’s db name wass_k_u
, this change fixed it tosku
- L’erreur
RecordNotFound
a été renommé enErrRecordNotFound
- Le dialecte
mssql
a été renommé engithub.com/jinzhu/gorm/dialects/mssql
Hstore
a été déplacé vers le paquetgithub.com/jinzhu/gorm/dialects/postgres