Skip to main content

def_elem_string

Function def_elem_string 

Source
pub fn def_elem_string(de: &DefElem) -> Option<String>
Expand description

Extract a string value from a DefElem.arg.

Handles the encodings pg_query uses for scalar option values:

  • NodeEnum::String — bare identifier or quoted string.
  • NodeEnum::Integer / NodeEnum::Float — numeric option values, stringified to their textual form.
  • NodeEnum::List — dollar-quoted bodies are wrapped in a List whose first item is the body String (the optional second item is the dollar-quote tag); this returns that first String’s value.

Returns None for an absent arg or any other node kind.