From 499726546cffeaa60914924523e3dbe315b72eba Mon Sep 17 00:00:00 2001 From: Olle Jonsson Date: Sat, 19 Nov 2022 16:55:51 +0100 Subject: [PATCH] README: add section on Alternatives [ci skip] --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 6c54028..9241083 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,12 @@ Real upsert for PostgreSQL 9.5+ and Rails 5.2+ / ActiveRecord 5.2+. Uses [ON CON - Ruby MRI, with the `pg` gem - _JRuby is currently not supported_ +## Alternatives + +This library was written at a time in history when Rails did not support any `#upsert` method. + +Instead of using this library, if you are using a current version of Rails, you may want to [use its `#upsert`](https://api.rubyonrails.org/classes/ActiveRecord/Persistence/ClassMethods.html#method-i-upsert). You may want to investigate how [newer PostgreSQL versions support `MERGE` statement](https://www.postgresql.org/docs/current/sql-merge.html). + ### NB: Releases to avoid Due to a broken build matrix, v0.9.2 and v0.9.3 are incompatible with Rails