Skip to content

Json columns aren't converted on SQL Server #53

@MNGoldenEagle

Description

@MNGoldenEagle

We're using bookshelf as an ORM solution between Postgres and SQL Server. Most of the functionality appears to be working, but I ran into a small hiccup with this plugin where it didn't perform JSON column conversions properly on SQL Server.

It looks like the issue has to do with how it's calculating parseOnFetch in the static block for the exported Bookshelf member. Currently it's only set if the client is SQLite, SQLite3, or MySQL. Adding a check for "mssql" leads to the desired behavior on SQL Server as well, though maybe it might make more sense to use client !== 'pg' instead, since only Postgres has a native JSON type?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions