Skip to main content

rows_as_json

Function rows_as_json 

Source
pub fn rows_as_json(sql: &str, limit: i64) -> String
Expand description

A caller’s SELECT wrapped to answer each row as JSON, limit rows at most. The SQL is wrapped, never concatenated onto another statement, and the newline after it keeps a query that ends in a -- comment from swallowing the limit.