First pass at uniformed types, specs and docs

- spec public functions (skipping controllers, views, live views and
components)
- use types instead of explanations in docs
- remove redundant docs
- fix typos
This commit is contained in:
Claudio Ortolina
2026-03-06 08:33:11 +00:00
parent 99e30d5fdf
commit 7cf9b4e7f8
81 changed files with 652 additions and 300 deletions
+8
View File
@@ -4,16 +4,24 @@ defmodule SqliteVec.Ecto.Float32 do
"""
use Ecto.Type
@impl true
@spec type() :: :binary
def type, do: :binary
@impl true
@spec cast(any()) :: {:ok, SqliteVec.Float32.t()}
def cast(value) do
{:ok, SqliteVec.Float32.new(value)}
end
@impl true
@spec load(binary()) :: {:ok, SqliteVec.Float32.t()}
def load(data) do
{:ok, SqliteVec.Float32.from_binary(data)}
end
@impl true
@spec dump(SqliteVec.Float32.t()) :: {:ok, binary()} | :error
def dump(%SqliteVec.Float32{} = vector) do
{:ok, SqliteVec.Float32.to_binary(vector)}
end