EXPAND ALL
  • Home

normalize_pgsql

Replaces constants with '$n' placeholders.Outputs the normalized query along with the values of the parameters

Returns: STRING

The normalized query with the values of the parameters in the query as JSON.

Arguments

VariableTypeDescription
sql_stringSTRINGThe PostgresSQL query string
cmd_codeSTRINGThe PostgresSQL command tag for this sql request.

Examples:

# Normalize the SQL query.
df.normalized_sql_json = px.normalize_pgsql(df.sql_query_string)
# Pluck the relevant values from the json.
df.normed_query = px.pluck(df.normalized_sql_json, 'query')
df.params = px.pluck(df.normalized_sql_json, 'params')
This site uses cookies to provide you with a better user experience. By using Pixie, you consent to our use of cookies.