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

inconsistency between docs and actual code for sqlite backend #1827

Closed
paulhersch opened this issue Dec 26, 2024 · 0 comments · Fixed by #1839
Closed

inconsistency between docs and actual code for sqlite backend #1827

paulhersch opened this issue Dec 26, 2024 · 0 comments · Fixed by #1839

Comments

@paulhersch
Copy link

Describe the bug
The sqlite connection with the config dict has the use of field "path" documented: https://tortoise.github.io/databases.html#required-parameters, but one has to use "file_path" as parameter.

To Reproduce

    "connections": {
        # dev connection
        "sqlite": {
            "engine": "tortoise.backends.sqlite",
            # path is documented, but file_path is used
            "credentials": {"path": "./dev.db.sqlite3"},
        },
    },
    "apps": {
        "myapp": {
            "models": ["myapp.db.models"],
            "default_connection": "sqlite",
        }
    },

Expected behavior
I would expect to be able to use "path" as per the documentation. It is also kind of confusing, that the path is part of the credentials, but it makes sense if you read the documentation for the other databases and the docstring of Tortoise.init. Using file_path should be part of the documentation, as i would guess user code now relies on that parameter being used.

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 a pull request may close this issue.

1 participant