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

SQLITE_OK, SQLITE_DENY and SQLITE_IGNORE not explicitly documented #96096

Closed
CAM-Gerlach opened this issue Aug 19, 2022 · 4 comments
Closed

SQLITE_OK, SQLITE_DENY and SQLITE_IGNORE not explicitly documented #96096

CAM-Gerlach opened this issue Aug 19, 2022 · 4 comments
Assignees
Labels
docs Documentation in the Doc dir topic-sqlite3

Comments

@CAM-Gerlach
Copy link
Member

CAM-Gerlach commented Aug 19, 2022

After #96095 is merged, the only remaining broken references/warnings in the sqlite3 library documentation are for the SQLITE_OK, SQLITE_DENY and SQLITE_IGNORE module-level constants that are referenced with :const: under Connection.set_authorizer, but not explicitly documented anywhere (as with the similar reference to sqlite.PrepareProtocol fixed in #94321). Should we at least add brief mentions of them to module constants, e.g.

.. data:: SQLITE_OK
          SQLITE_DENY
          SQLITE_IGNORE

   Flag that *authorizer_callback* of :meth:`Connection.set_authorizer`
   should return to indicate whether:

   * Access is allowed (:const:`!SQLITE_OK`),
   * The SQL statement should be aborted with an error (:const:`!SQLITE_DENY`)
   * The column should be treated as a ``NULL`` value (:const:`!SQLITE_IGNORE`)

Also, maybe Connection.set_authorizer()'s docs should be updated to say something like "The callback should return :const:SQLITE_OK. :const:SQLITE_DENY. or :const:SQLITE_IGNORE to control the resulting behavior for the column" rather than repeating ourselves.

@erlend-aasland what do you think?

@erlend-aasland
Copy link
Contributor

Yep, we should document these, as they are part of the authorizer interface. Note that only SQLITE_DENY and SQLITE_IGNORE are specific to the authorizer callback.

FYI: Every SQLite result code is available as module level attributes. There are 152 of them. It may not make sense to cover each and everyone. Anyway, that is out of scope of this issue.

@CAM-Gerlach
Copy link
Member Author

Thanks @erlend-aasland . As the resident sqlite3 expert, I would ideally defer to your expertise, but if you would rather I do so, I could submit a PR with the above changes—up to you.

@erlend-aasland
Copy link
Contributor

I won't have time the next few days, so if you feel the urge, please go ahead 🙂

@CAM-Gerlach
Copy link
Member Author

Thanks, opened as #96134

erlend-aasland added a commit that referenced this issue Aug 23, 2022
…96134)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Aug 23, 2022
…nts (pythonGH-96134)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
(cherry picked from commit d6259c5)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Aug 23, 2022
…nts (pythonGH-96134)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
(cherry picked from commit d6259c5)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
miss-islington added a commit that referenced this issue Aug 23, 2022
…H-96134)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
(cherry picked from commit d6259c5)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
miss-islington added a commit that referenced this issue Aug 23, 2022
…H-96134)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
(cherry picked from commit d6259c5)

Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
mdboom pushed a commit to mdboom/cpython that referenced this issue Aug 24, 2022
…nts (python#96134)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir topic-sqlite3
Projects
Status: Done
Development

No branches or pull requests

2 participants