juji-io / datalevin

A simple, fast and versatile Datalog database
https://github.com/juji-io/datalevin
Eclipse Public License 1.0
1.07k stars 60 forks source link

Fix `:validate-data? true` not working for some types #236

Closed andersmurphy closed 4 months ago

andersmurphy commented 4 months ago

:validate-data? true doesn't work for some types.

Some type mismatches can cause b/indexable to throw an error before validation happens. This error doesn't happen when you pass a string instead of a UUID, which is why the current tests don't catch this.

This fix moves validation to be called before b/indexable.

I've added more tests cases to capture this issue.

Let me know if you want me to make any changes.

huahaiy commented 4 months ago

Good catch. Thanks!