Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PosgreSQL AGE Viewer node_ids as Text not HEX #635

Open
Daggle24 opened this issue Jan 24, 2025 · 0 comments
Open

PosgreSQL AGE Viewer node_ids as Text not HEX #635

Daggle24 opened this issue Jan 24, 2025 · 0 comments

Comments

@Daggle24
Copy link

Is there any way to see the node id's as text in the AGE viewer ? I've found a way to see it like this:

First I made this custom function:

CREATE OR REPLACE FUNCTION hex_to_utf8(hex_str TEXT) RETURNS TEXT AS $$
DECLARE
    clean_hex TEXT;
    utf8_str TEXT;
BEGIN
    -- Remove 'x' prefix
    clean_hex := REGEXP_REPLACE(hex_str, '^x', '');
    -- Convert from hex to bytes, then utf8
    utf8_str := CONVERT_FROM(DECODE(clean_hex, 'hex'), 'UTF8');
    RETURN utf8_str;
END;
$$ LANGUAGE plpgsql;

Then I execute a query like this.

SELECT
    hex_to_utf8((to_json(result.n)->'properties'->>'node_id')) AS node_id_utf8,
	*
FROM cypher('amaine_pg', $$
    MATCH (n)-[r]-(m)
    RETURN n,r,m
    LIMIT 10
$$) AS result(
    n agtype,
	r agtype,
	m agtype
);

but I can only see it in the table page

Image

But in the GRAPH visualizer I only get a blank screen.

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant