Skip to content

Add vector_concat() and vector_slice() functions#2144

Closed
dhairyadev26 wants to merge 2 commits intotursodatabase:mainfrom
dhairyadev26:add-vector-concat-and-slice
Closed

Add vector_concat() and vector_slice() functions#2144
dhairyadev26 wants to merge 2 commits intotursodatabase:mainfrom
dhairyadev26:add-vector-concat-and-slice

Conversation

@dhairyadev26
Copy link
Copy Markdown

This PR adds support for two new vector functions:

  • vector_concat(x, y) – Concatenates two vectors of the same type.
  • vector_slice(x, start_index, end_index) – Extracts a subvector from the input vector.

These functions were already implemented in Turso, and adding them to libSQL maintains compatibility between the two projects.

Closes #2136

Notes:

  • Both functions require vectors of the same type
  • vector_slice with negative indices is not supported
  • start_index must be less than end_index
  • Comprehensive error checking is included for edge cases

A test SQL file is included to verify functionality of both functions.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add vector_concat() and vector_slice() functions

1 participant