Skip to main content
POST
/
api
/
v2
/
database
/
sql
Python
from samplehc import SampleHealthcare

client = SampleHealthcare(
    api_key="My API Key",
)
response = client.v2.database.execute_sql(
    query="query",
)
print(response.rows)
{
  "rows": [
    {}
  ]
}

Body

application/json
query
string
required

The SQL query to execute.

params
array

An array of parameters to be used in the SQL query. Supports primitive types (string, number, boolean, null), arrays, and objects. Use placeholders like $1, $2, etc. in the query string. Examples: ["hello", 123, [1,2,3], {"name": "John", "age": 30}]

Response

The result of the SQL query execution.

rows
required

An array of results from the query. Each item is an object with the column names as keys.

I