{"modulePath":"github.com/facebook/ent","version":"v0.5.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package sqljson\n\n## Functions\n\n```go\nfunc HasKey(column string, opts ...Option) *sql.Predicate\n```\nHasKey return a predicate for checking that a JSON key exists and not NULL.\n\n\tsqljson.HasKey(\"column\", sql.DotPath(\"a.b[2].c\"))\n\n```go\nfunc LenEQ(column string, size int, opts ...Option) *sql.Predicate\n```\nLenEQ return a predicate for checking that an array length of a JSON (returned by the path) is equal to the given argument.\n\n\tsqljson.LenEQ(\"a\", 1, sqljson.Path(\"b\"))\n\n```go\nfunc LenGT(column string, size int, opts ...Option) *sql.Predicate\n```\nLenGT return a predicate for checking that an array length of a JSON (returned by the path) is greater than the given argument.\n\n\tsqljson.LenGT(\"a\", 1, sqljson.Path(\"b\"))\n\n```go\nfunc LenGTE(column string, size int, opts ...Option) *sql.Predicate\n```\nLenGTE return a predicate for checking that an array length of a JSON (returned by the path) is greater than or equal to the given argument.\n\n\tsqljson.LenGTE(\"a\", 1, sqljson.Path(\"b\"))\n\n```go\nfunc LenLT(column string, size int, opts ...Option) *sql.Predicate\n```\nLenLT return a predicate for checking that an array length of a JSON (returned by the path) is less than the given argument.\n\n\tsqljson.LenLT(\"a\", 1, sqljson.Path(\"b\"))\n\n```go\nfunc LenLTE(column string, size int, opts ...Option) *sql.Predicate\n```\nLenLTE return a predicate for checking that an array length of a JSON (returned by the path) is less than or equal to the given argument.\n\n\tsqljson.LenLTE(\"a\", 1, sqljson.Path(\"b\"))\n\n```go\nfunc LenNEQ(column string, size int, opts ...Option) *sql.Predicate\n```\nLenNEQ return a predicate for checking that an array length of a JSON (returned by the path) is not equal to the given argument.\n\n\tsqljson.LenEQ(\"a\", 1, sqljson.Path(\"b\"))\n\n```go\nfunc LenPath(b *sql.Builder, column string, opts ...Option)\n```\nLenPath writes to the given SQL builder the JSON path for getting the length of a given JSON path.\n\n\tsqljson.LenPath(b, Path(\"a\", \"b\", \"[1]\", \"c\"))\n\n```go\nfunc ParsePath(dotpath string) ([]string, error)\n```\nParsePath parses the \"dotpath\" for the DotPath option.\n\n\t\"a.b\"\t\t=\u003e [\"a\", \"b\"]\n\t\"a[1][2]\"\t=\u003e [\"a\", \"[1]\", \"[2]\"]\n\t\"a.\\\"b.c\\\"\t=\u003e [\"a\", \"\\\"b.c\\\"\"]\n\n```go\nfunc ValueContains(column string, arg interface{}, opts ...Option) *sql.Predicate\n```\nValueContains return a predicate for checking that a JSON value (returned by the path) contains the given argument.\n\n\tsqljson.ValueContains(\"a\", 1, sqljson.Path(\"b\"))\n\n```go\nfunc ValueEQ(column string, arg interface{}, opts ...Option) *sql.Predicate\n```\nValueEQ return a predicate for checking that a JSON value (returned by the path) is equal to the given argument.\n\n\tsqljson.ValueEQ(\"a\", 1, sqljson.Path(\"b\"))\n\n```go\nfunc ValueGT(column string, arg interface{}, opts ...Option) *sql.Predicate\n```\nValueGT return a predicate for checking that a JSON value (returned by the path) is greater than the given argument.\n\n\tsqljson.ValueGT(\"a\", 1, sqljson.Path(\"b\"))\n\n```go\nfunc ValueGTE(column string, arg interface{}, opts ...Option) *sql.Predicate\n```\nValueGTE return a predicate for checking that a JSON value (returned by the path) is greater than or equal to the given argument.\n\n\tsqljson.ValueGTE(\"a\", 1, sqljson.Path(\"b\"))\n\n```go\nfunc ValueLT(column string, arg interface{}, opts ...Option) *sql.Predicate\n```\nValueLT return a predicate for checking that a JSON value (returned by the path) is less than the given argument.\n\n\tsqljson.ValueLT(\"a\", 1, sqljson.Path(\"b\"))\n\n```go\nfunc ValueLTE(column string, arg interface{}, opts ...Option) *sql.Predicate\n```\nValueLTE return a predicate for checking that a JSON value (returned by the path) is less than or equal to the given argument.\n\n\tsqljson.ValueLTE(\"a\", 1, sqljson.Path(\"b\"))\n\n```go\nfunc ValueNEQ(column string, arg interface{}, opts ...Option) *sql.Predicate\n```\nValueNEQ return a predicate for checking that a JSON value (returned by the path) is not equal to the given argument.\n\n\tsqljson.ValueNEQ(\"a\", 1, sqljson.Path(\"b\"))\n\n```go\nfunc ValuePath(b *sql.Builder, column string, opts ...Option)\n```\nValuePath writes to the given SQL builder the JSON path for getting the value of a given JSON path.\n\n\tsqljson.ValuePath(b, Path(\"a\", \"b\", \"[1]\", \"c\"), Cast(\"int\"))\n\n## Types\n\n```go\ntype Option func(*PathOptions)\n```\nOption allows for calling database JSON paths with functional options.\n\n```go\nfunc Cast(typ string) Option\n```\nCast indicates that the result value should be casted to the given type.\n\n\tValuePath(b, \"column\", Path(\"a\", \"b\", \"[1]\", \"c\"), Cast(\"int\"))\n\n```go\nfunc DotPath(dotpath string) Option\n```\nDotPath is similar to Path, but accepts string with dot format.\n\n\tValuePath(b, \"column\", DotPath(\"a.b.c\"))\n\tValuePath(b, \"column\", DotPath(\"a.b[2].c\"))\n\nNote that DotPath is ignored if the input is invalid.\n\n```go\nfunc Path(path ...string) Option\n```\nPath sets the path to the JSON value of a column.\n\n\tValuePath(b, \"column\", Path(\"a\", \"b\", \"[1]\", \"c\"))\n\n```go\nfunc Unquote(unquote bool) Option\n```\nUnquote indicates that the result value should be unquoted.\n\n\tValuePath(b, \"column\", Path(\"a\", \"b\", \"[1]\", \"c\"), Unquote(true))\n\n```go\ntype PathOptions struct {\n\tIdent   string\n\tPath    []string\n\tCast    string\n\tUnquote bool\n}\n```\nPathOptions holds the options for accessing a JSON value from an identifier.\n\n","path":"github.com/facebook/ent/dialect/sql/sqljson","name":"sqljson","synopsis":"","isRedistributable":true}
