---
title: "POST /v1/projects/{project}/instances/{instance}/executeSql"
method: POST
path: "/v1/projects/{project}/instances/{instance}/executeSql"
tags: ["instances"]
---

# POST /v1/projects/{project}/instances/{instance}/executeSql

`POST /v1/projects/{project}/instances/{instance}/executeSql`

Execute SQL statements.

## Path parameters

- `project` string, required
- `instance` string, required

## Request body

- ExecuteSqlPayload — The request payload used to execute SQL statements.
  - `sqlStatement` string — Required. SQL statements to run on the database. It can be a single statement or a sequence of statements separated by semicolons.
  - `partialResultMode` 'PARTIAL_RESULT_MODE_UNSPECIFIED' | 'FAIL_PARTIAL_RESULT' | 'ALLOW_PARTIAL_RESULT' — Optional. Controls how the API should respond when the SQL execution result is incomplete due to the size limit or another error. The default mode is to throw an error.
  - `user` string — Optional. The name of an existing database user to connect to the database. When `auto_iam_authn` is set to true, this field is ignored and the API caller's IAM user is used.
  - `autoIamAuthn` boolean — Optional. When set to `true`, the API caller identity associated with the request is used for database authentication. The API caller must be an IAM user in the database.
  - `database` string — Optional. Name of the database on which the statement will be executed.
  - `rowLimit` string, int64 — Optional. The maximum number of rows returned per SQL statement.
  - `application` string — Optional. Specifies the name of the application that is making the request. This field is used for telemetry. Only alphanumeric characters, dashes, and underscores are allowed. The maximum length is 32 characters.

## Response `200`

Successful response

---

[API](https://skmtc.net/google/apis/sqladmin.md) · [All operations](https://skmtc.net/google/apis/sqladmin/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/google/sqladmin/versions/e9eef8a2afcd/schema)
