For AI agents: the complete documentation index is available at /hclapi/llms.txt, the full documentation bundle is available at /hclapi/llms-full.txt, and this page is available as Markdown at /hclapi/docs/manifest/functions/math/parse_int.md.

parse_int

Parses an integer from a string representation in the specified base (2 to 36).

Signature

parse_int(str: string, base: int) -> int

Parameters

ParameterTypeRequiredDescription
str, basestring, intyesNumeric string and radix 2–36

Return value

Returns the documented result for the function signature.

Example

sql "find_by_bitmask" {
  connection = connection.postgres.main
  query = "SELECT id FROM records WHERE flags = @mask"
  args = { mask = parse_int(ctx.request.query.hex_flag, 16) }
}