-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Improve JSON and Jason support #4565
Comments
you mentioned all adapters, does the problem appear in all of them or just exqlite? |
We can just do |
Right. I also see this unit https://github.com/elixir-ecto/ecto/blob/master/lib/ecto/json.ex, may need to implement the |
I made a PR that handles some of the needed changes, but am I correct in thinking that the |
Yes, they must! |
Elixir version
1.18
Database and Version
all
Ecto Versions
any
Database Adapter and Versions (postgrex, myxql, etc)
postgrex, myxql, exqlite
Current behavior
When running Elixir 1.18 and setting the json adapter to
JSON
, we encounter issues whereencode/1
is not defined, butencode!/1
is. This issue was started here elixir-sqlite/ecto_sqlite3#159Expected behavior
I should be able to flip between
Jason
andJSON
to support Elixir 1.17 and 1.18.A "quick-ish" fix is to wrap the
encode!/1
from bothJason
andJSON
with atry rescue
to keep the{:ok, term} | {:error, term}
typespec behaviour.The text was updated successfully, but these errors were encountered: