(inspector: Inspector, session: Session)
| 213 | reason="ATTACH is not supported for DuckDB version < 0.7.0", |
| 214 | ) |
| 215 | def test_get_table_names(inspector: Inspector, session: Session) -> None: |
| 216 | # Using multi-line strings because of all the single and double quotes flying around... |
| 217 | cmds = [ |
| 218 | """CREATE TABLE "daffy duck"."quack quack"."t2" (i INTEGER, j INTEGER);""", |
| 219 | """CREATE TABLE "t3" (i INTEGER, j INTEGER);""", |
| 220 | """CREATE SCHEMA "porky" """, |
| 221 | """CREATE TABLE "porky"."t4" (i INTEGER, j INTEGER);""", |
| 222 | ] |
| 223 | for cmd in cmds: |
| 224 | session.execute(text(cmd)) |
| 225 | session.commit() |
| 226 | |
| 227 | for schema, table_names in zip( |
| 228 | ['"daffy duck"."quack quack"', "main", "porky"], [["t1", "t2"], ["t3"], ["t4"]] |
| 229 | ): |
| 230 | _table_names = inspector.get_table_names(schema=schema) |
| 231 | assert set(_table_names).issuperset(set(table_names)) |
| 232 | for _table_name in _table_names: |
| 233 | assert inspector.has_table(_table_name, schema) |
| 234 | |
| 235 | table_names_all = inspector.get_table_names() |
| 236 | assert set(table_names_all).issuperset({"t1", "t2", "t3", "t4"}) |
| 237 | for table_name in table_names_all: |
| 238 | assert inspector.has_table(table_name) |
| 239 | |
| 240 | |
| 241 | def test_get_views(conn: Connection, dialect: Dialect) -> None: |
nothing calls this directly
no test coverage detected