Skip to content

Support for variant / semi-structured / JSON columns #13

@mingp

Description

@mingp

Snowflake supports a column type called variant, which supports JSON and other JSON-like semi-structured data. One syntax to be able to index a variant column is by using the colon character, what the Snowflake documentation calls dot notation, per docs here.

As far as I can tell, there is no current support for this notation. If, in a where, I try to specify a field as this dot notation, e.g. foo:bar, then the query compiler mistakenly tries to quote this as "foo:bar", when the correct quotation is supposed to be "foo":"bar". This results in an error.

I've found that Knex supports a custom wrapIdentifier, per docs here. This is definitely one possible work-around. As far as I can tell, knex-snowflake-dialect already supplies its own wrapIdentifier implementation, but it doesn't support dot notation. Hence, the above issue.

I'm working on seeing if I can get a work-around to work locally. Perhaps, however, this should be integrated into the library.

Let me know your thoughts. Thanks.

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