Skip to content

Conversation

@chriteixeira
Copy link

JSON Serialization Fix:

  • Fixed execute_sql function to return valid JSON format instead of Python repr format (e.g., Decimal('75000.00') → 75000.0)
  • Added custom JSON serializer that properly handles PostgreSQL data types:
    • Decimal → float
    • datetime/date → ISO string format
    • timedelta → total seconds
    • bytes/binary → base64 encoding
    • UUID → string representation

CSV Output Format:

  • Added new output_format parameter to execute_sql function with options: "json" (default) or "csv"
  • Implemented format_csv_response() function that converts query results to proper CSV format
  • CSV format preserves decimal precision and handles complex data types appropriately

@chriteixeira chriteixeira marked this pull request as draft September 26, 2025 02:01
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.

1 participant