fix: enhance database schema handling for SQLite and PostgreSQL

- Updated schema configuration to set None for SQLite databases.
- Added schema creation logic in the connection wrapper for PostgreSQL.
- Adjusted migration environment to ignore schema for SQLite.
- Fixed unquote parameters in connection tests for consistency.
This commit is contained in:
hobart
2025-05-26 11:33:21 +09:00
parent b203a72c61
commit ea0f54064e
4 changed files with 30 additions and 5 deletions

View File

@@ -38,8 +38,8 @@ class TestWrappers:
result = register_connection(db_url)
# Assertions
mock_connect.assert_called_once_with(db_url, unquote_password=True)
mock_parse.assert_called_once_with(db_url, unquote_password=True)
mock_connect.assert_called_once_with(db_url, unquote_user=True, unquote_password=True)
mock_parse.assert_called_once_with(db_url, unquote_user=True, unquote_password=True)
# Check that options were added with schema
expected_connection = {
@@ -186,7 +186,7 @@ class TestWrappers:
result = register_connection(db_url)
# Assertions
mock_connect.assert_called_once_with(db_url, unquote_password=True)
mock_connect.assert_called_once_with(db_url, unquote_user=True, unquote_password=True)
# Verify SQLite database properties are set
assert mock_sqlite_db.autoconnect is True