Skip to content

[proposal] Support _custom  #150

@caibirdme

Description

@caibirdme

There're many cases that user want to use some new types such as JSON in sql. And new types are bound to related function calls. It's hard to enumerate them all, so we should give user a chance to insert some custom part of the sql in the where map.

// PartialSelection
type PartialSelection interface {
  Generate() (string, []interface{})
}

{
  "_custom_xx": typeA_impl_PartialSelection,
  "_custom_asd": typeB_impl_PartialSelection,
}

the key must be prefixed with _custom_ which tells gendry to carefully handle the PartialSelection.

And then, we can add some builtin functions that produce PartialSelection like:

func JSONContains(col, val, path string) PartialSelection

And user can also impl their owns as well

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