FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix: pass codec options to db.command() by msyavuz · Pull Request #39 · passren/PyMongoSQL · GitHub

fix: pass codec options to db.command() - #39

Merged
passren merged 1 commit into
passren:mainfrom
msyavuz:fix/command-codec-options
Jul 17, 2026
Merged

fix: pass codec options to db.command()#39
passren merged 1 commit into
passren:mainfrom
msyavuz:fix/command-codec-options

Conversation

msyavuz commented Jul 16, 2026
edited
Loading

Copy link
Copy Markdown
Contributor

Database.command() falls back to DEFAULT_CODEC_OPTIONS when codec_options is omitted, so options configured on the client were ignored on every read. Most visibly, uuidRepresentation had no effect: BSON UUID fields were decoded as raw bson.Binary instead of uuid.UUID no matter what the connection string asked for, because reads go through db.command({'find': ...}) rather than collection.find().

  # mongodb://.../db?uuidRepresentation=standard
  cur.execute("SELECT * FROM testUuid")
  cur.fetchall()   # -> Binary(b'\xbc\xf9...', 4)   expected: UUID('bcf9a897-...')

Pass the database's codec options for both find and getMore, so results decode consistently with collection.find() and across batches.

Database.command() falls back to DEFAULT_CODEC_OPTIONS when codec_options is
omitted, so options configured on the client were ignored on every read. Most
visibly, uuidRepresentation had no effect: BSON UUID fields were decoded as raw
bson.Binary instead of uuid.UUID no matter what the connection string asked for,
because reads go through db.command({'find': ...}) rather than collection.find().

Pass the database's codec options for both find and getMore, so results decode
consistently with collection.find() and across batches.
passren merged commit a3f1102 into passren:main Jul 17, 2026
24 checks passed

passren commented Jul 17, 2026

Copy link
Copy Markdown
Owner

@msyavuz Thank you for contributing. The PR was merged and it will be included in the next release.

msyavuz commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Thank you @passren for taking a look and merging! Any idea when the next release will be cut?

passren commented Jul 18, 2026

Copy link
Copy Markdown
Owner

@msyavuz v0.7.3 was released that includes your fix. Thank you!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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


Back | FazBrowse Home | New Git URL