Skip to content

Support pgvector element-wise arithmetic #65

Description

@alexeichhorn

Context

pgvector provides element-wise vector arithmetic, while dbkit currently exposes distance/similarity operations only.

Supported pgvector operators include:

  • vector + vector — element-wise addition
  • vector - vector — element-wise subtraction
  • vector * vector — element-wise multiplication

Expected behavior

  • Support +, -, and * for PgVector<N> expressions.
  • Return PgVector<N> for required operands and Option<PgVector<N>> when either operand is nullable.
  • Require matching const dimensions at compile time.
  • Reject vector/scalar and mismatched-dimension pairs.
  • Cover column, literal, and computed-expression operands in both required/nullable combinations.
  • Verify projected results against pgvector integration tests.

pgvector vector operators

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions