quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.36k stars 2.56k forks source link

PostgreSQL DevServices with embedding Vectors #41569

Open lordofthejars opened 5 days ago

lordofthejars commented 5 days ago

Description

Currently, if you want to use PostgreSQL with the hibernate-vector dependency, when using DevServices with PostgreSQL database, it starts the service with a standard PostgreSQL database image (so no vector type available).

It would be great that if DevServices detects the hibernate-vector dependency, could start the ankane/pgvector:v0.5.1 container image and execute the following command before executing any Hibernate SQL command:

CREATE EXTENSION IF NOT EXISTS vector;

Of course there are workarounds like using quarkus.datasource.devservices.image-name=ankane/pgvector:v0.5.1 and then create an import.sql file with the SQL command. But would be great that devs can smoothly start using vectors.

Implementation ideas

No response

melloware commented 5 days ago

I opened this ticket too on the Postgres Embedded extension: https://github.com/quarkiverse/quarkus-embedded-postgresql/issues/97