laravel/telescope

Error with ::vector(1536) – pgvector + PostgreSQL

オープン

#1,612 opened on 2025/07/20

 (2 件のコメント) (0 件のリアクション) (0 人の担当者)PHP (654 件のフォーク)user submission
help wanted

Repository metrics

Stars
 (5,187 個のスター)
PR merge metrics
 (平均マージ 7h 14m) (30d で 6 merged PRs)

説明

Telescope Version

5.10.0

Laravel Version

12.20.0

PHP Version

8.4.10

Database Driver & Version

pgsql 17

Description

I’m running into a parsing error when using a query like this in Telescope:

Parse error: Unexpected "::vector(1"
This likely happens because you're using the default "sql" dialect.

This is the line that seems to break it:

?::vector(1536)

It’s valid PostgreSQL syntax when using the pgvector extension, works fine in the database itself. But whatever is parsing the query (probably for display or formatting in the frontend) doesn’t seem to recognize the ::vector cast and throws an error.

My Query (Truncated):

WITH vectorchord_candidates AS (
    SELECT id, chunk, embedding, agent_file_id,
           {$distanceOperator}
    FROM documents
    WHERE agent_id = ?
    ORDER BY embedding <-> ?::vector(1536)
    LIMIT ?
)

Steps To Reproduce

Steps to Reproduce

  1. Use PostgreSQL with the pgvector extension installed.
  2. Run a query that uses ?::vector. Example:
use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\DB;

Route::get('/test', function () {
    DB::select('
        SELECT ARRAY[0.0, 0.1, 0.2, 0.3, 0.4, 0.0]::vector(6) AS test_vector
    ');
});
  1. Open the query in Telescope.

コントリビューターガイド