File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
pgvector-module/src/main/kotlin/griffio Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ import app.cash.sqldelight.dialect.api.PrimitiveType
6
6
import app.cash.sqldelight.dialect.api.SqlDelightModule
7
7
import app.cash.sqldelight.dialect.api.TypeResolver
8
8
import app.cash.sqldelight.dialect.api.PrimitiveType.BOOLEAN
9
+ import app.cash.sqldelight.dialects.postgresql.PostgreSqlType
9
10
import app.cash.sqldelight.dialects.postgresql.PostgreSqlTypeResolver
10
11
import app.cash.sqldelight.dialects.postgresql.grammar.psi.PostgreSqlTypes
11
12
import com.alecstrong.sql.psi.core.psi.SqlFunctionExpr
@@ -59,8 +60,9 @@ private class PgVectorTypeResolver(private val parentResolver: TypeResolver) : P
59
60
60
61
override fun functionType (functionExpr : SqlFunctionExpr ): IntermediateType ? =
61
62
when (functionExpr.functionName.text.lowercase()) {
62
- " subvector " -> IntermediateType (PgVectorSqlType . VECTOR )
63
+ " binary_quantize " -> IntermediateType (PostgreSqlType . BIT )
63
64
" cosine_distance" -> IntermediateType (PrimitiveType .REAL )
65
+ " subvector" -> IntermediateType (PgVectorSqlType .VECTOR )
64
66
else -> parentResolver.functionType(functionExpr)
65
67
}
66
68
}
Original file line number Diff line number Diff line change 27
27
// PostgreSql type_name will be replaced - need to inline inherited types plus new vector data types
28
28
type_name ::= (
29
29
vector_data_type |
30
+ {bit_data_type}
30
31
{small_int_data_type} |
31
32
{int_data_type} |
32
33
{big_int_data_type} |
You can’t perform that action at this time.
0 commit comments