Extract Query

Query Strings

The extract_query_string function extracts the query string from a URL as a single string.

D SELECT extract_query_string('example.com?key=value') AS query;
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   query   β”‚
β”‚  varchar  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ key=value β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

D SELECT extract_query_string('http://example.com.ac/path/?a=1&b=2') AS query;
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  query  β”‚
β”‚ varchar β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ a=1&b=2 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Query Parameters

The extract_query_parameters table function parses the query string and returns each key-value pair as a separate row. This is useful for analyzing URL parameters in a structured way.

Last updated

Was this helpful?