perf: use raw query for reading int-pk docs too (#32286)

Currently only string PK is supported but that wasn't the intention,
isinstance check is only there to avoid dicts/filters.
This commit is contained in:
Ankush Menat 2025-04-24 18:41:07 +05:30 committed by GitHub
parent 7c2205b703
commit d998d520fb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -231,7 +231,7 @@ class Document(BaseDocument, DocRef):
self._fix_numeric_types()
else:
if not is_doctype and isinstance(self.name, str):
if not is_doctype and isinstance(self.name, str | int):
for_update = ""
if self.flags.for_update and frappe.db.db_type != "sqlite":
for_update = "FOR UPDATE"