Skip to content

gh-137974: add execute_json method for JSON output - #137980

Closed
MengAiDev wants to merge 3 commits into
python:mainfrom
MengAiDev:137974
Closed

MengAiDev wants to merge 3 commits into
python:mainfrom
MengAiDev:137974

Conversation

@MengAiDev

@MengAiDev MengAiDev commented Aug 20, 2025 •

Copy link
Copy Markdown
  • Add execute_json method to Cursor class
  • Update documentation and add new test file
  • Implement JSON result generation in C extension

📚 Documentation preview 📚: https://cpython-previews--137980.org.readthedocs.build/

- Add execute_json method to Cursor class
- Update documentation and add new test file
- Implement JSON result generation in C extension
@picnixz

picnixz commented Aug 20, 2025

Copy link
Copy Markdown
Member

Sorry, but I'm going to close this one until the feature has been sufficiently discussed. In the feature, please don't open PRs when the feature hasn't been accepted and triaged. TiA.

@picnixz picnixz closed this Aug 20, 2025
Comment thread Modules/_sqlite/cursor.c
}

// Complete the JSON query
PyObject *full_query = PyUnicode_FromFormat("SELECT json_group_array(json_object(%S)) FROM (%U) AS row", column_str, sql);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is quite the pull request! Unfortunately, I have tested this and I've been unable to get back anything other than empty JSON dictionaries.

@ssmycelium

Copy link
Copy Markdown

This is pretty impressive! I am curious, did you write this or was it AI assisted? It was a lot of code pretty fast, and it looks very clean.

@MengAiDev
MengAiDev deleted the 137974 branch August 20, 2025 23:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants