Skip to content

Commit

Permalink
Added Pgvector.extensions/0 function
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed May 18, 2024
1 parent aa479fe commit d5e574a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## 0.2.2 (unreleased)

- Added `Pgvector.extensions/0` function
- Added `l1_distance` function for Ecto

## 0.2.1 (2023-09-25)
Expand Down
9 changes: 9 additions & 0 deletions lib/pgvector.ex
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ defmodule Pgvector do
end
end
end

@doc """
Extensions for Postgrex
"""
def extensions do
[
Pgvector.Extensions.Vector
]
end
end

defimpl Inspect, for: Pgvector do
Expand Down
2 changes: 1 addition & 1 deletion test/test_helper.exs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Postgrex.Types.define(EctoApp.PostgrexTypes, [Pgvector.Extensions.Vector] ++ Ecto.Adapters.Postgres.extensions(), [])
Postgrex.Types.define(EctoApp.PostgrexTypes, Pgvector.extensions() ++ Ecto.Adapters.Postgres.extensions(), [])

defmodule Repo do
use Ecto.Repo,
Expand Down

0 comments on commit d5e574a

Please sign in to comment.