class_docstr: A connection to a SQL database using a SQLAlchemy Engine. Initialize using ``st.connection("<name>", type="sql")``.
  
  SQLConnection provides the ``query()`` convenience method, which can be used to
  run simple read-only queries with both caching and simple error handling/retries.
  More complex DB interactions can be performed by using the ``.session`` property
  to receive a regular SQLAlchemy Session.
  
  SQLConnections should always be created using ``st.connection()``, **not**
  initialized directly. Connection parameters for a SQLConnection can be specified
  using either ``st.secrets`` or ``**kwargs``. Some frequently used parameters include:
  
  - **url** or arguments for `sqlalchemy.engine.URL.create()
    <https://docs.sqlalchemy.org/en/20/core/engines.html#sqlalchemy.engine.URL.create>`_.
    Most commonly it includes a dialect, host, database, username and password.
  
  - **create_engine_kwargs** can be passed via ``st.secrets``, such as for
    `snowflake-sqlalchemy <https://github.com/snowflakedb/snowflake-sqlalchemy#key-pair-authentication-support>`_
    or `Google BigQuery <https://github.com/googleapis/python-bigquery-sqlalchemy#authentication>`_.
    These can also be passed directly as ``**kwargs`` to connection().
  
  - **autocommit=True** to run with isolation level ``AUTOCOMMIT``. Default is False.
  
  Example
  -------
  >>> import streamlit as st
  >>>
  >>> conn = st.connection("sql")
  >>> df = conn.query("select * from pet_owners")
  >>> st.dataframe(df)
class_docstr_tok: ["A","connection","to","a","SQL","database","using","a","SQLAlchemy","Engine",".","Initialize","using","``","st.connection","(","``","<","name",">","''",",","type=","''","sql","''",")","``",".","SQLConnection","provides","the","``","query","(",")","``","convenience","method",",","which","can","be","used","to","run","simple","read-only","queries","with","both","caching","and","simple","error","handling\/retries",".","More","complex","DB","interactions","can","be","performed","by","using","the","``",".session","``","property","to","receive","a","regular","SQLAlchemy","Session",".","SQLConnections","should","always","be","created","using","``","st.connection","(",")","``",",","*","*","not","*","*","initialized","directly",".","Connection","parameters","for","a","SQLConnection","can","be","specified","using","either","``","st.secrets","``","or","``","*","*","kwargs","``",".","Some","frequently","used","parameters","include",":","-","*","*","url","*","*","or","arguments","for","`","sqlalchemy.engine.URL.create","(",")","<","https",":","\/\/docs.sqlalchemy.org\/en\/20\/core\/engines.html","#","sqlalchemy.engine.URL.create",">","`","_",".","Most","commonly","it","includes","a","dialect",",","host",",","database",",","username","and","password",".","-","*","*","create_engine_kwargs","*","*","can","be","passed","via","``","st.secrets","``",",","such","as","for","`","snowflake-sqlalchemy","<","https",":","\/\/github.com\/snowflakedb\/snowflake-sqlalchemy","#","key-pair-authentication-support",">","`","_","or","`","Google","BigQuery","<","https",":","\/\/github.com\/googleapis\/python-bigquery-sqlalchemy","#","authentication",">","`","_",".","These","can","also","be","passed","directly","as","``","*","*","kwargs","``","to","connection","(",")",".","-","*","*","autocommit=True","*","*","to","run","with","isolation","level","``","AUTOCOMMIT","``",".","Default","is","False",".","Example","--","--","--","-",">",">",">","import","streamlit","as","st",">",">",">",">",">",">","conn","=","st.connection","(","``","sql","''",")",">",">",">","df","=","conn.query","(","``","select","*","from","pet_owners","''",")",">",">",">","st.dataframe","(","df",")"]
docstr: The underlying SQLAlchemy Engine.
  
  This is equivalent to accessing ``self._instance``.
docstr_tok: ["The","underlying","SQLAlchemy","Engine",".","This","is","equivalent","to","accessing","``","self._instance","``","."]
code: def engine(self) -> "Engine":
      """The underlying SQLAlchemy Engine.
  
      This is equivalent to accessing ``self._instance``.
      """
      return self._instance
  
file_path: streamlit/lib/streamlit/connections/sql_connection.py
imports: from __future__ import annotations
  from collections import ChainMap
  from copy import deepcopy
  from datetime import timedelta
  from typing import TYPE_CHECKING, List, Optional, Union, cast
  import pandas
  from streamlit.connections import BaseConnection
  from streamlit.connections.util import extract_from_dict
  from streamlit.errors import StreamlitAPIException
  from streamlit.runtime.caching import cache_data
label_desc: Use image node_id 4 for calling the SQLConnection obj's underlying member method code with example usage: obj.engine() and returns: self