import { type SQL, type AnyColumn } from "drizzle-orm"; /** * TiDB / MySQL JSON functions that **create** JSON values, for Drizzle `sql` fragments. * @see https://docs.pingcap.com/tidb/stable/json-functions/json-functions-create */ export type JsonSqlInput = SQL | AnyColumn | string | number | boolean; export type JsonContainsPathMode = "one" | "all"; export type JsonSearchMode = "one" | "all"; /** `JSON_ARRAY([val ...])` */ export declare function jsonArray(...values: JsonSqlInput[]): SQL; /** * `JSON_OBJECT([key, val ...])` — arguments must alternate key, value (even count). * @throws If the number of arguments is odd */ export declare function jsonObject(...keyValues: JsonSqlInput[]): SQL; /** `JSON_QUOTE(str)` */ export declare function jsonQuote(str: JsonSqlInput): SQL; /** `JSON_CONTAINS(json_doc, candidate [, path])` */ export declare function jsonContains(jsonDoc: JsonSqlInput, candidate: JsonSqlInput, path?: JsonSqlInput): SQL; /** `JSON_CONTAINS_PATH(json_doc, one_or_all, path [, path ...])` */ export declare function jsonContainsPath(jsonDoc: JsonSqlInput, mode: JsonContainsPathMode, ...paths: JsonSqlInput[]): SQL; /** `JSON_EXTRACT(json_doc, path [, path ...])` */ export declare function jsonExtract(jsonDoc: JsonSqlInput, ...paths: JsonSqlInput[]): SQL; /** `column -> path` alias of `JSON_EXTRACT(column, path)` */ export declare function jsonGet(jsonDoc: JsonSqlInput, path: JsonSqlInput): SQL; /** `column ->> path` alias of `JSON_UNQUOTE(JSON_EXTRACT(column, path))` */ export declare function jsonGetUnquote(jsonDoc: JsonSqlInput, path: JsonSqlInput): SQL; /** `JSON_KEYS(json_doc [, path])` */ export declare function jsonKeys(jsonDoc: JsonSqlInput, path?: JsonSqlInput): SQL; /** `JSON_SEARCH(json_doc, one_or_all, str [, escape_char [, path ...]])` */ export declare function jsonSearch(jsonDoc: JsonSqlInput, mode: JsonSearchMode, searchStr: JsonSqlInput, escapeChar?: JsonSqlInput, ...paths: JsonSqlInput[]): SQL; /** `value MEMBER OF (json_array)` */ export declare function memberOf(value: JsonSqlInput, jsonArrayExpr: JsonSqlInput): SQL; /** `JSON_OVERLAPS(json_doc1, json_doc2)` */ export declare function jsonOverlaps(left: JsonSqlInput, right: JsonSqlInput): SQL; /** `JSON_APPEND(...)` — deprecated alias for `JSON_ARRAY_APPEND(...)` */ export declare function jsonAppend(jsonDoc: JsonSqlInput, ...pathValues: JsonSqlInput[]): SQL; /** `JSON_ARRAY_APPEND(json_doc, path, value [, path, value] ...)` */ export declare function jsonArrayAppend(jsonDoc: JsonSqlInput, ...pathValues: JsonSqlInput[]): SQL; /** `JSON_ARRAY_INSERT(json_doc, path, value [, path, value] ...)` */ export declare function jsonArrayInsert(jsonDoc: JsonSqlInput, ...pathValues: JsonSqlInput[]): SQL; /** `JSON_INSERT(json_doc, path, value [, path, value] ...)` */ export declare function jsonInsert(jsonDoc: JsonSqlInput, ...pathValues: JsonSqlInput[]): SQL; /** `JSON_MERGE_PATCH(json_doc, json_doc [, json_doc] ...)` */ export declare function jsonMergePatch(first: JsonSqlInput, ...docs: JsonSqlInput[]): SQL; /** `JSON_MERGE_PRESERVE(json_doc, json_doc [, json_doc] ...)` */ export declare function jsonMergePreserve(first: JsonSqlInput, ...docs: JsonSqlInput[]): SQL; /** `JSON_MERGE(...)` — deprecated alias of `JSON_MERGE_PRESERVE(...)` */ export declare function jsonMerge(first: JsonSqlInput, ...docs: JsonSqlInput[]): SQL; /** `JSON_REMOVE(json_doc, path [, path] ...)` */ export declare function jsonRemove(jsonDoc: JsonSqlInput, ...paths: JsonSqlInput[]): SQL; /** `JSON_REPLACE(json_doc, path, value [, path, value] ...)` */ export declare function jsonReplace(jsonDoc: JsonSqlInput, ...pathValues: JsonSqlInput[]): SQL; /** `JSON_SET(json_doc, path, value [, path, value] ...)` */ export declare function jsonSet(jsonDoc: JsonSqlInput, ...pathValues: JsonSqlInput[]): SQL; /** `JSON_UNQUOTE(json)` */ export declare function jsonUnquote(value: JsonSqlInput): SQL; /** `JSON_DEPTH(json_doc)` */ export declare function jsonDepth(jsonDoc: JsonSqlInput): SQL; /** `JSON_LENGTH(json_doc [, path])` */ export declare function jsonLength(jsonDoc: JsonSqlInput, path?: JsonSqlInput): SQL; /** `JSON_TYPE(json_val)` */ export declare function jsonType(jsonVal: JsonSqlInput): SQL; /** `JSON_VALID(str)` */ export declare function jsonValid(str: JsonSqlInput): SQL; /** `JSON_PRETTY(json_doc)` */ export declare function jsonPretty(jsonDoc: JsonSqlInput): SQL; /** `JSON_STORAGE_FREE(json_doc)` */ export declare function jsonStorageFree(jsonDoc: JsonSqlInput): SQL; /** `JSON_STORAGE_SIZE(json_doc)` */ export declare function jsonStorageSize(jsonDoc: JsonSqlInput): SQL; /** `JSON_ARRAYAGG(expr)` */ export declare function jsonArrayAgg(expr: JsonSqlInput): SQL; /** `JSON_OBJECTAGG(key, value)` */ export declare function jsonObjectAgg(key: JsonSqlInput, value: JsonSqlInput): SQL; /** * `JSON_SCHEMA_VALID(schema, json_doc)` * * TiDB validates schema strictly and can error on invalid schema documents. */ export declare function jsonSchemaValid(schema: JsonSqlInput, jsonDoc: JsonSqlInput): SQL; //# sourceMappingURL=JsonTiDB.d.ts.map