Skip to content

Add "path" column to html_each #8

@asg017

Description

@asg017

Similar to the fullkey / path columns in json_each/json_tree.

sqlite> select fullkey, path, key, value from json_tree('{"sub": {"name": "alex"}}');
┌────────────┬───────┬──────┬─────────────────────────┐
│  fullkey   │ path  │ key  │          value          │
├────────────┼───────┼──────┼─────────────────────────┤
│ $          │ $     │      │ {"sub":{"name":"alex"}} │
│ $.sub      │ $     │ sub  │ {"name":"alex"}         │
│ $.sub.name │ $.sub │ name │ alex                    │
└────────────┴───────┴──────┴─────────────────────────┘

But instead, it's a CSS selector to the exact HTML Element, similar to the "copy path" button in Chrome Devtools.

image

The catch: this is pretty difficult to calculate, here's Chrome's implementation of it.
https://github.com/ChromeDevTools/devtools-frontend/blob/69ed2407734d98fdbaaabaac91fb679ca73bd88c/front_end/panels/elements/DOMPath.ts#L73-L171

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions