Skip to content

Conversation

@bloeys
Copy link
Contributor

@bloeys bloeys commented Feb 24, 2025

Hi Raphael,

I have made a small addition that allows users to inject 'handlers' at runtime to add support for types that aren't handled by default. As an example of how this is used, I have made jai-pgvector, which adds support for the vector type from the popular pgvector extension, which we need in our company.

This should also make it very easy for others to add support for other types and other extensions, like PostGIS, for example. If you like, we can also use this ability to add some of the more popular types and extensions in Jaipg itself, as an on-demand feature (e.g. people who want pgvector call init_pgvector or similar).

Wish you a nice day 😊

Copy link
Owner

@rluba rluba left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good! Do you have a sample implementation for any type that we could add to examples/example.jai to (a) document how it works and (b) use as a regression test?

@bloeys
Copy link
Contributor Author

bloeys commented Jul 14, 2025

Regarding a reference implementation, currently the only one I have is jai-pgvector, which is 1 file of ~130 lines. Perhaps we can add that as a module and use it in the example, and reference it?

@bloeys
Copy link
Contributor Author

bloeys commented Jan 21, 2026

I added usage of registering a handler in the examples that uses jai-pgvector.

Tell me if you would like any other changes :)

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.

2 participants