code: def test_read_database(
      read_method: str,
      connect_using: Any,
      expected_dtypes: dict[str, pl.DataType],
      expected_dates: list[date | str],
      schema_overrides: SchemaDict | None,
      batch_size: int | None,
      tmp_path: Path,
  ) -> None:
      tmp_path.mkdir(exist_ok=True)
      test_db = str(tmp_path / "test.db")
      create_temp_sqlite_db(test_db)
  
      if read_method == "read_database_uri":
          # instantiate the connection ourselves, using connectorx/adbc
          df = pl.read_database_uri(
              uri=f"sqlite:///{test_db}",
              query="SELECT * FROM test_data",
              engine=str(connect_using),  # type: ignore[arg-type]
              schema_overrides=schema_overrides,
          )
      elif "adbc" in os.environ["PYTEST_CURRENT_TEST"]:
          # externally instantiated adbc connections
          with connect_using(test_db) as conn, conn.cursor():
              df = pl.read_database(
                  connection=conn,
                  query="SELECT * FROM test_data",
                  schema_overrides=schema_overrides,
                  batch_size=batch_size,
              )
      else:
          # other user-supplied connections
          df = pl.read_database(
              connection=connect_using(test_db),
              query="SELECT * FROM test_data WHERE name NOT LIKE '%polars%'",
              schema_overrides=schema_overrides,
              batch_size=batch_size,
          )
  
      assert df.schema == expected_dtypes
      assert df.shape == (2, 4)
      assert df["date"].to_list() == expected_dates
  
imports: from __future__ import annotations
  import os
  import sqlite3
  import sys
  from contextlib import suppress
  from datetime import date
  from pathlib import Path
  from types import GeneratorType
  from typing import TYPE_CHECKING, Any, NamedTuple
  import pytest
  from sqlalchemy import Integer, MetaData, Table, create_engine, func, select
  from sqlalchemy.sql.expression import cast
  import polars
  from polars.exceptions import UnsuitableSQLError
  from polars.io.database import _ARROW_DRIVER_REGISTRY_
  from polars.testing import assert_frame_equal
label_desc: Use image node_id 3 for calling a global function with example usage: test_read_database(read_method, connect_using, expected_dtypes, expected_dates, schema_overrides, batch_size, tmp_path) without return types