Support for WITH clauses when creating indexes for AshPostgres

I have this statement in my resource to create a index:

      statement :hnsw_embedding_index do
        up """
        CREATE INDEX IF NOT EXISTS bookworm_chunks_embedding_hnsw_idx
          ON bookworm_chunks
          USING hnsw (embedding vector_cosine_ops)
          WITH (m = 16, ef_construction = 200)
        """

        down "DROP INDEX IF EXISTS bookworm_chunks_embedding_hnsw_idx"
      end

As you can see, the index has a WITH clause, in Ecto, it can be represented by the :options option, how can I do the same using a custom_index?

Looks like we don’t support options currently. Will need to add it :smiley: Please open an issue or PR :person_bowing:

1 Like