BryanJBryce

BryanJBryce

Configuring Ash Postgres to use usec date times

config :ash, :utc_datetime_type, :datetime

I’m doing this configuration in my project, I can’t remember why, it was probably in one of the official guides.

My question is: is this using millisecond or second precision timestamps? What other options are there instead of :datetime?

Marked As Solved

zachdaniel

zachdaniel

Creator of Ash

Its referring to absinthe’s builtin :datetime type (the graphql type, not the ash type), which ISO8601 formats any given datetime, so IIRC it will have microseconds or not, depending on what the datetime given to it has.

Also Liked

zachdaniel

zachdaniel

Creator of Ash

Ah, interesting…thats pretty frustrating. That should say config :ash_graphql, ...

Here is the relevant error message if its not set


   No type configured for utc_datetimes!

    The existing default of using `:naive_datetime` for `:utc_datetime` and `:utc_datetime_usec` is being deprecated.

    To prevent accidental API breakages, we are requiring that you configure your selected type for these, via

        # This was the previous default, so use this if you want to ensure no unintended
        # change in your API, although switching to `:datetime` eventually is suggested.
        config :ash, :utc_datetime_type, :naive_datetime

        or

        config :ash, :utc_datetime_type, :datetime

    When the 1.0 version of ash_graphql is released, the default will be changed to `:datetime`, and this error message will
    no longer be shown (but any configuration set will be retained indefinitely).

Where Next?

Popular in Questions Top

New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
JorisKok
I have a server on AWS, and was running a load test using artillery. When looking at the Phoenix dashboard I see the Ports going to 100% ...
New
svb
Hi! Currently I want to submit a form by pressing the Enter key. However, since my input field is of type “textarea” this is just adds a...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

Other popular topics Top

KronicDeth
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine) This is a plugin that adds support for Elixir to JetBrains IntelliJ...
289 36820 110
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
jason.o
In the code below, if the create action is not set to accept “extra_key” as an input, it errors out with a message shown above. Is there ...
New
AstonJ
Posting this to see if we can make things easier for people to get into Neovim. If you use Neovim and have a favourite distro please let ...
New

We're in Beta

About us Mission Statement