Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

it would be better to add the __fspath__ method SimpleSQLite class #86

Closed
bindi-mo opened this issue Feb 18, 2025 · 1 comment
Closed

Comments

@bindi-mo
Copy link

_extractor.py for sqliteschema module

class SQLiteSchemaExtractor:
...
        if is_connection_required:
            if not os.path.isfile(database_source):
                raise OSError(f"file not found: {database_source}")

if isinstance(database_source, SimpleSQLite) is true and database_source.is_connected() is false , then is_connection_required is true.
And an exception will be thrown because the SimpleSQLite class does not have a __fspath__ method.
Wouldn't it be better to add a __fspath__ method?

in core.py

class SimpleSQLite:
    def __fspath__(self) -> str:
        return self.__database_path
thombashi added a commit that referenced this issue Feb 22, 2025
Signed-off-by: Tsuyoshi Hombashi <[email protected]>
thombashi added a commit that referenced this issue Feb 23, 2025
Signed-off-by: Tsuyoshi Hombashi <[email protected]>
thombashi added a commit that referenced this issue Mar 1, 2025
@thombashi
Copy link
Owner

Implemented at SimpleSQLite 1.5.4
Thank you for your feedback.

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

No branches or pull requests

2 participants