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

Postgres timestamp column causes sync to fail #28

Open
brandantck opened this issue Oct 26, 2023 · 6 comments
Open

Postgres timestamp column causes sync to fail #28

brandantck opened this issue Oct 26, 2023 · 6 comments

Comments

@brandantck
Copy link

brandantck commented Oct 26, 2023

Postgres: v15

config.yml

progress: 
  type: file 

I am trying to sync a table from a Postgres database with the column type:timestamp, and its throwing this error.
image

This is an example of a row in the database
image

Seems like the error occurs when its trying to do a json.dumps into the progress.json file.

Edit: Tried with redis but still getting the same error, issue might not lie with writing to progress

@sanders41
Copy link
Contributor

datetime is not json serializable so that is most likely causing the issue. I'm not sure the full context here so this my not be possible but if you can convert your dates to an iso string before dumping it should fix the issue.

An example of how to convert:

condition_start_datetime = datetime.datetime(2010, 4, 1, 0, 0)
converted = condition_start_datetime.isoformat()

@long2ice
Copy link
Owner

Maybe you can use plugins

@brandantck
Copy link
Author

When i run the meilisync refresh command, it doesnt seem to run the plugin pre_event or post_event functions

@long2ice
Copy link
Owner

Yes, that's a problem...

@brandantck
Copy link
Author

Ah okay, so currently, the plugins are only loaded and used on the meilisync start command?

@long2ice
Copy link
Owner

You can try latest code now

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

No branches or pull requests

3 participants