How to store Swift types (Date, Dictionary and others) in PostgreSQL with Vapor 3?

576 Views Asked by At

I am using Vapor 3, Swift 5.1, PostgreSQL 12 and Postico 1.5.10 for my Backend. Question is: how to store Date (I mean Swift Date()) and Dictionary (example, [String : Int])?

To work with PostgeSQL, I am using Postico (I am quite newbie in PostgreSQL, that's why), please look at screenshot: enter image description here

And, I just have seen how to store Arrays, but where I can find other types to store? For example, Enum?

I will be thankful for any help or advice!

1

There are 1 best solutions below

4
On BEST ANSWER
  • for date timestamp without time zone
  • for [String: Any] should be jsonb