docs: def execute(self, text, **params):
          """Execute a SQL statement."""
  
          class UserDefinedType(sqlalchemy.TypeDecorator):
              """Add support for expandable values, a la https://github.com/sqlalchemy/sqlalchemy/issues/3953."""
  
              # Required class-level attribute
              # https://docs.sqlalchemy.org/en/latest/core/custom_types.html#sqlalchemy.types.TypeDecorator
              impl = sqlalchemy.types.UserDefinedType
  
              def process_literal_param(self, value, dialect):
                  """Receive a literal parameter value to be rendered inline within a statement."""
  
                  def process(value):
                      """Render a literal value, escaping as needed."""
  
                      # bool
                      if type(value) is bool:
                          return sqlalchemy.types.Boolean().literal_processor(dialect)(value)
  
                      # datetime.date
                      elif type(value) is datetime.date:
                          return sqlalchemy.types.String().literal_processor(dialect)(value.strftime("%Y-%m-%d"))
  
                      # datetime.datetime
                      elif type(value) is datetime.datetime:
                          return sqlalchemy.types.String().literal_processor(dialect)(value.strftime("%Y-%m-%d %H:%M:%S"))
  
                      # datetime.time
                      elif type(value) is datetime.time:
                          return sqlalchemy.types.String().literal_processor(dialect)(value.strftime("%H:%M:%S"))
  
                      # float
                      elif type(value) is float:
                          return sqlalchemy.types.Float().literal_processor(dialect)(value)
  
                      # int
                      elif type(value) is int:
                          return sqlalchemy.types.Integer().literal_processor(dialect)(value)
  
                      # long
                      elif sys.version_info.major != 3 and type(value) is long:
                          return sqlalchemy.types.Integer().literal_processor(dialect)(value)
  
                      # str
                      elif type(value) is str:
                          return sqlalchemy.types.String().literal_processor(dialect)(value)
  
                      # None
                      elif type(value) is sqlalchemy.sql.elements.Null:
                          return sqlalchemy.types.NullType().literal_processor(dialect)(value)
  
                      # Unsupported value
                      raise RuntimeError("unsupported value")
  
                  # Process value(s), separating with commas as needed
                  if type(value) is list:
                      return ", ".join([process(v) for v in value])
                  else:
                      return process(value)
  
          # Allow only one statement at a time, since SQLite doesn't support multiple
          # https://docs.python.org/3/library/sqlite3.html#sqlite3.Cursor.execute
          if len(sqlparse.split(text)) > 1:
              raise RuntimeError("too many statements at once")
  
          # Raise exceptions for warnings
          warnings.filterwarnings("error")
  
          # Prepare, execute statement
          try:
  
              # Construct a new TextClause clause
              statement = sqlalchemy.text(text)
  
              # Iterate over parameters
              for key, value in params.items():
  
                  # Translate None to NULL
                  if value is None:
                      value = sqlalchemy.sql.null()
  
                  # Bind parameters before statement reaches database, so that bound parameters appear in exceptions
                  # http://docs.sqlalchemy.org/en/latest/core/sqlelement.html#sqlalchemy.sql.expression.text
                  statement = statement.bindparams(sqlalchemy.bindparam(
                      key, value=value, type_=UserDefinedType()))
  
              # Stringify bound parameters
              # http://docs.sqlalchemy.org/en/latest/faq/sqlexpressions.html#how-do-i-render-sql-expressions-as-strings-possibly-with-bound-parameters-inlined
              statement = str(statement.compile(compile_kwargs={"literal_binds": True}))
  
              # Statement for logging
              log = re.sub(r"\n\s*", " ", sqlparse.format(statement, reindent=True))
  
              # Execute statement
              result = self.engine.execute(statement)
  
              # If SELECT (or INSERT with RETURNING), return result set as list of dict objects
              if re.search(r"^\s*SELECT", statement, re.I):
  
                  # Coerce any decimal.Decimal objects to float objects
                  # https://groups.google.com/d/msg/sqlalchemy/0qXMYJvq8SA/oqtvMD9Uw-kJ
                  rows = [dict(row) for row in result.fetchall()]
                  for row in rows:
                      for column in row:
                          if type(row[column]) is decimal.Decimal:
                              row[column] = float(row[column])
                  ret = rows
  
              # If INSERT, return primary key value for a newly inserted row
              elif re.search(r"^\s*INSERT", statement, re.I):
                  if self.engine.url.get_backend_name() in ["postgres", "postgresql"]:
                      result = self.engine.execute(sqlalchemy.text("SELECT LASTVAL()"))
                      ret = result.first()[0]
                  else:
                      ret = result.lastrowid
  
              # If DELETE or UPDATE, return number of rows matched
              elif re.search(r"^\s*(?:DELETE|UPDATE)", statement, re.I):
                  ret = result.rowcount
  
              # If some other statement, return True unless exception
              else:
                  ret = True
  
          # If constraint violated, return None
          except sqlalchemy.exc.IntegrityError:
              self.logger.debug(termcolor.colored(log, "yellow"))
              return None
  
          # If user errror
          except sqlalchemy.exc.OperationalError as e:
              self.logger.debug(termcolor.colored(log, "red"))
              e = RuntimeError(self._parse(e))
              e.__cause__ = None
              raise e
  
          # Return value
          else:
              self.logger.debug(termcolor.colored(log, "green"))
              return ret