Skip to content

Commit f379fd2

Browse files
committed
Simplified code
1 parent 6a68606 commit f379fd2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/pgvector.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ function pgvector.deserialize(v)
3131
end
3232

3333
function pgvector.setup_vector(pg)
34-
local res = table.unpack(pg:query("SELECT to_regtype('vector')::oid AS oid"))
35-
assert(res, "vector type not found in the database")
36-
pg:set_type_deserializer(res.oid, "vector", function(self, v) return pgvector.deserialize(v) end)
34+
local row = pg:query("SELECT to_regtype('vector')::oid AS vector_oid")[1]
35+
assert(row["vector_oid"], "vector type not found in the database")
36+
pg:set_type_deserializer(row["vector_oid"], "vector", function(self, v) return pgvector.deserialize(v) end)
3737
end
3838

3939
return pgvector

0 commit comments

Comments
 (0)