Json Path Builder
Create a Path builder using one of the many reified methods.
From a class:
val builder = TestObject::class.with(TestObject::statuses) {
then(Status::createdAt)
}Content copied to clipboard
From a property:
val builder = TestObject::statuses.builder {
then(Status::createdAt)
}
Quick joining two properties:Content copied to clipboard
val builder = TestObject::statuses.then(Status::createdAt) { // can optionally keep going }
Classes like [OrderBy] and [Where] operators take [JsonPathBuilder] or [KProperty1] to build
the path for sql queries.Content copied to clipboard
Functions
Link copied to clipboard
Builds a pattern that matches the json_tree fullkey of the targeted node, for use as fullkey LIKE ? ESCAPE '\'. SQLite emits a key unquoted only when it is [A-Za-z][A-Za-z0-9]*; otherwise it double-quotes it (e.g. $."user_name"). We reproduce that quoting and escape LIKE metacharacters in the key, so a _/% in a field name is matched literally instead of acting as a wildcard (which previously leaked sibling keys — see #69). The [%] array token is left as a deliberate wildcard (match any index).
Link copied to clipboard