vapor / fluent-postgres-driver

🐘 PostgreSQL driver for Fluent.
MIT License
146 stars 53 forks source link

Custom JSON Coder for Postgres Coders #129

Closed calebkleveter closed 4 years ago

calebkleveter commented 4 years ago

Relies on https://github.com/vapor/postgres-kit/pull/159

calebkleveter commented 4 years ago

What if we added a method to DatabaseRow that attempted to cast it to a _PostgresDatabaseRow and then extract the PostgresRow from that?

extension DatabaseRow {
    public func postgresRow() -> PostgresRow? {
        return (self as? _PostgresDatabaseRow)?.row
    }
}