| 477 | |
| 478 | |
| 479 | def test_config(tmp_path: Path) -> None: |
| 480 | db_path = tmp_path / "test.db" |
| 481 | |
| 482 | db = duckdb.connect(str(db_path)) |
| 483 | db.execute("create table hello1 (i int)") |
| 484 | db.close() |
| 485 | |
| 486 | eng = create_engine( |
| 487 | f"duckdb:///{db_path}", |
| 488 | connect_args={"read_only": True, "config": {"memory_limit": "500mb"}}, |
| 489 | ) |
| 490 | |
| 491 | with raises( |
| 492 | DBAPIError, |
| 493 | match='Cannot execute statement of type "CREATE" (on database "test" which is attached )?in read-only mode!', |
| 494 | ): |
| 495 | with eng.connect() as conn: |
| 496 | conn.execute(text("create table hello2 (i int)")) |
| 497 | |
| 498 | |
| 499 | def test_url_config() -> None: |