# SQL Query[¶](https://doc.dataiku.com/dss/latest/api/python/sqlquery.html#sql-query "Permalink to this headline")

## Reference documentation[¶](https://doc.dataiku.com/dss/latest/api/python/sqlquery.html#module-dataikuapi.dss.sqlquery "Permalink to this headline")

*class* `dataikuapi.dss.sqlquery.``DSSSQLQuery`(*client*, *query*, *connection*, *database*, *dataset\_full\_name*, *pre\_queries*, *post\_queries*, *type*, *extra\_conf*, *script\_steps*, *script\_input\_schema*, *script\_output\_schema*, *script\_report\_location*, *read\_timestamp\_without\_timezone\_as\_string*, *read\_date\_as\_string*, *project\_key*)

A connection to a database or database-like on which queries can be run through DSS. Do not create this class directly, instead use `dataikuapi.DSSClient.sql\_query()`

`get_schema`()

Get the query’s result set’s schema

* Returns:: the schema as a JSON array of columns

`iter_rows`()

Get the query’s results

* Returns:: an iterator over the rows, each row being a tuple of values. The order of values
in the tuples is the same as the order of columns in the schema returned by get\_schema

`verify`()

Verify that the result set streaming completed successfully and was not truncated

* Raises:: if the query failed at some point while streaming the results, an exception will be raised.
If the call completes without exception, then the query was successfully streamed
