mirror of
https://github.com/open-webui/open-webui
synced 2025-06-26 18:26:48 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user