Skip to content

Conversation

@gianchub
Copy link
Owner

  • Remove sqlalchemy-utils dependency
  • Add our own functions to create, drop and check if a database exists
  • Add tests for those functions
  • Some scaffolding.

- Introduced a new test suite for the db_util module, covering functions such as _get_postgres_admin_uri, _get_sqlite_file_path, create_database, and database_exists.
- Enhanced _get_postgres_admin_uri to handle cases where the port is not specified.
- Updated _get_sqlite_file_path to return None for empty paths and improved handling of edge cases.
- Simplified assertions in the test suite for database existence by removing explicit comparisons to True/False, enhancing readability.
- Updated tests for PostgreSQL and SQLite to use more concise assertion styles.
- Added assertions to verify the existence of the in-memory SQLite database after creation.
- Improved clarity of the test by ensuring checks are performed before and after the database creation.
- Removed redundant import of create_engine from within the test method.
- Consolidated import statements for improved readability and organization.
- Adjusted the test for creating an in-memory SQLite database to assert that it exists after the creation call, reflecting the behavior of in-memory databases.
- Improved clarity by adding comments to explain the assertions and their expected outcomes.
mmcardle
mmcardle previously approved these changes Dec 10, 2025
Copy link
Collaborator

@mmcardle mmcardle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Im aware most of the code changes come from copied code from sqlalchemy-utils so happy to approve as is without the changes i have commented on.

@gianchub gianchub merged commit 8334923 into main Dec 10, 2025
14 checks passed
@gianchub gianchub deleted the remove-utils branch December 10, 2025 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants