Skip to content

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

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

Closed
wants to merge 3 commits into from

Conversation

MengAiDev
Copy link

@MengAiDev MengAiDev commented Aug 20, 2025

  • 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
Copy link
Member

picnixz commented Aug 20, 2025

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
}

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

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

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