Kitura / Swift-Kuery-ORM

An ORM for Swift, built on Codable
Apache License 2.0
212 stars 30 forks source link

More fine grain control on what Date columns use .timestamp vs .date, etc... #124

Open xeokeri opened 4 years ago

xeokeri commented 4 years ago

Improve DateEncodingFormat Support

There is only one way per table to set all columns using Date to one format. For example:

public static var dateEncodingFormat: DateEncodingFormat = .timestamp

or

public static var dateEncodingFormat: DateEncodingFormat = .date

Steps to Reproduce

public fileprivate(set) var date: Date
public fileprivate(set) var updated: Date

public static var dateEncodingFormat: DateEncodingFormat = .timestamp

In this example, var date: should be .date, and var updated: should be .timestamp, to be more fine grained to their respective use cases in this table.

Expected vs. Actual Behaviour