Skip to main content

Module quote

Module quote 

Source
Expand description

GQL quoting and sanitization helpers.

These mirror the Go reference client’s SanitizeGraphName, QuoteIdent, and QuoteString so that user-supplied names and string literals can be inlined into GQL admin statements without opening an injection vector.

Functions§

quote_ident
Validates and returns name in a form safe to inline into a GQL admin statement that takes an identifier (CREATE USER, ALTER USER, CREATE MIGRATION, etc.).
quote_string
Returns s wrapped in GQL single quotes, with backslashes and single quotes properly escaped.
sanitize_graph_name
Returns name stripped of any character that is not alphanumeric, underscore, or hyphen, so it can be inlined safely into a USE GRAPH statement without opening an injection vector.