-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Postgrex v0.14.0 #141
Comments
Postgrex v0.14.0 expects the JSON encoder to provide an This is needed for EventStore to support the |
@slashdotdash What would you consider as a valid change for this? Would maybe a migration to Jason + a version bump to |
As both Postgrex and Phoenix have migrated from Poison to Jason for JSON encoding then EventStore can do the same. In which case we should deprecate support for Poison and previous Postgrex versions (v0.13.0 and older). This will also impact Commanded since it uses Poison for event data & metadata deserialization (in The Jason library outlines its differences from Poison, namely:
Not being able to natively encode arbitrary structs may cause issues since Poison does not require a custom encoder for nested structs, but Jason does. Ideally I'd like EventStore to support middleware for writing/reading events allowing you to specify your own serializer and any additional event processing (e.g. encryption, enrichment, upcasting, versioning, auditing, etc.). |
Yes, I am aware, I already have written a Jason serializer, so when I get the time I'll look into these issues and send a PR 💙 💜 ❤️ |
Hi, just trying out Commanded, and experiencing this problem. What is the recommended workaround, if I can't wait for this PR to be merged and a new release been published? Thanks. |
@raarts Unfortunately there is no workaround since Postgrex v0.14.0 has broken the integration with Poison for JSON serialization. We need to migrate EventStore to use Jason. |
None at all? Maybe I can go back to an older Postgrex version (I am using phoenix 1.4 though) |
Phoenix doesn't have a dependency on Postgrex. I'm assuming you are also using Ecto v3 which does depend upon the latest Postgrex release. You could try using Ecto v2.2.x instead for now. |
@slashdotdash I tried but got stuck in compile errors/dependency problems. I'll have to wait. Any timeline? |
Just in case someone else has the same problem, this worked:
(Did not find a way to keep two different versions of that mix task on my machine and pick between them) |
It would have been enough to use postrex 1.3 in your 1.4 Phoenix app
…On Wed, Dec 5, 2018, 10:57 Ron Arts ***@***.*** wrote:
Just in case someone else has the same problem, this worked:
mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new-1.3.4.ez
mix phx.new eventsourcing
mix archive.install hex phx_new 1.4.0
(Did not find a way to keep two different versions of that mix task on my
machine and pick between them)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#141 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADH2sypSp7GgZ1R5akF_OUIePSvyHBg1ks5u15iGgaJpZM4YQpsP>
.
|
Well, I just tried again, but:
Adding override: true to the postgrex dependency resulted in:
Next I changed the mix.exs file in deps/ecto_sql to require 1.0 with override, but running I remember an earlier attempt ending up in compile errors. So I guess it's not as easy as it looks. |
Yes, yes, its Ecto 3 causing that not much to do with phoenix as slashdot
noted. We are working on a migration but seems no one really has the time
for it at the moment..
…On Wed, 5 Dec 2018 at 13:16, Ron Arts ***@***.***> wrote:
Well, I just tried again, but:
Failed to use "postgrex" because
apps/api/mix.exs requires ~> 0.13.0
ecto_sql (version 3.0.0) requires ~> 0.14.0
Adding override: true to the postgrex dependency resulted in:
Failed to use "db_connection" (versions 2.0.0 to 2.0.3) because
ecto_sql (version 3.0.0) requires ~> 2.0
postgrex (versions 0.13.0 to 0.13.5) requires ~> 1.1
Next I changed the mix.exs file in deps/ecto_sql to require 1.0 with
override, but running mix deps.get after that change did not seem to pick
that up, was still complaining about requiring 2.0. Tried editing mix.lock
file, but also didn't get picked up, and then I was lost.
I remember an earlier attempt ending up in compile errors. So I guess it's
not as easy as it looks.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#141 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADH2s8dIVT9J6Dx2HYaDRXR-3HKpBWm3ks5u17kRgaJpZM4YQpsP>
.
|
There is no other |
What's the solution for this? |
The blocking issue is to migrate JSON serialization from Poison to Jason. This is a significant and breaking change which needs to be carefully implemented. Unfortunately I don’t have time right now to do so. Can you continue using Postgrex v0.13.x for now? |
We're continuing to use Phoenix 1.3 and Postgrex 0.13 for now. Eagerly awaiting an update :) Thanks |
Still can't compile on a new project:
Deps:
Elixir: 1.7.4 Compiled with OTP 21.2 |
@sleepiejohn You need to use Postgrex v0.13.5 |
Even though everyone has different setups, hoping people might find this helpful. Here are the packages I had to downgrade (running multiple phoenix 1.4 apps in umbrella): removed |
Am I right in thinking this is done now? Looks like there are commits in master switching from poison to Jason |
Yes, it's done in #143 and included in the v0.16.0 release published to Hex. |
Attempting to compile EventStore with the latest version of Postgrex published to Hex (v0.14.0) fails with the following compile error:
This is because
Postgrex.Timestamp
has been deprecated and removed from Postgrex which is used inEventStore.Storage.Reader
. The usage must be made optional (e.g.Code.ensure_loaded?(Postgrex.Timestamp)
) to support both v0.13.0 and older and the latest v0.14.0.The text was updated successfully, but these errors were encountered: