Closed gregnr closed 1 year ago
Thanks! I'm actually getting vector
columns as text
from PostgREST though:
create table t (c vector(3));
insert into t values ('[1,2,3]'), ('[4,5,6]');
[
{
"c": "[1,2,3]"
},
{
"c": "[4,5,6]"
}
]
Ah seems like I can do:
> curl 'https://<...>.supabase.co/rest/v1/t?select=c::_float4' -H 'Authorization: Bearer <...>' -H 'apikey: <...>' | jq
[
{
"c": [
1,
2,
3
]
},
{
"c": [
4,
5,
6
]
}
]
This needs casting support on postgrest-js though - will take a look at that
Woah, TIL you can cast over PostgREST 😃
This needs casting support on postgrest-js though - will take a look at that
Thanks! I imagine this means we should default it as a string instead (we probably shouldn't implicitly cast)?
we should default it as a string instead (we probably shouldn't implicitly cast)?
Yup, agreed :+1:
Great, updated it to a string
now.
:tada: This PR is included in version 0.63.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Adds pgvector's
vector
data type to TypeScript generation logic to produce anumber[]
string
type.Edit:
vector
actually produces astring
, eg"[1,2,3]"
.