Skip to content
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

[SQLtools] fix exception "Object of type datetime is not JSON serializable" with MySQL server #976

Merged
merged 1 commit into from
May 29, 2024

Conversation

D3fau4
Copy link
Contributor

@D3fau4 D3fau4 commented May 22, 2024

As we discussed on discord, when using sqltools if you connect it to a MySQL server it gives error when trying to serialize a datetime field and this could be easily avoided by giving a default when serializing the results to json.

return json.dumps(self.run_sql(sql=query, limit=limit), default=str)

@ysolanky ysolanky mentioned this pull request May 22, 2024
@ashpreetbedi ashpreetbedi merged commit e3dafa3 into phidatahq:main May 29, 2024
1 check passed
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.

3 participants