Skip to content

feat: 增加pg向量类型字段支持#98

Merged
zhou-hao merged 6 commits intohs-web:4.2from
goten7:feat-4.2-pg-vector
Apr 2, 2026
Merged

feat: 增加pg向量类型字段支持#98
zhou-hao merged 6 commits intohs-web:4.2from
goten7:feat-4.2-pg-vector

Conversation

@goten7
Copy link
Copy Markdown
Contributor

@goten7 goten7 commented Apr 1, 2026

No description provided.

@goten7
Copy link
Copy Markdown
Contributor Author

goten7 commented Apr 1, 2026

@zhou-hao 大佬,麻烦看看这个

@zhou-hao
Copy link
Copy Markdown
Member

zhou-hao commented Apr 1, 2026

执行了pg相关单元测试没? 增加一个向量相关数据库操作的单元测试?

@zhou-hao
Copy link
Copy Markdown
Member

zhou-hao commented Apr 1, 2026

有没有支持vector字段的相关termbuilder?

@goten7
Copy link
Copy Markdown
Contributor Author

goten7 commented Apr 1, 2026

有没有支持vector字段的相关termbuilder?

有的,准备放在jetlinks-components下面。需要放到这边来吗

@zhou-hao
Copy link
Copy Markdown
Member

zhou-hao commented Apr 2, 2026

如果针对vector 字段本身有特定操作方式的话就放到这里来

public static String getVectorColumn(String columnFullName, VectorTermType type, Float[] vector) {
return PrepareSqlFragments
.of(columnFullName)
.addSql(type.getOperation(), "'" + toVectorLiteral(vector) + "'")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是否可以使用预编译参数?

.toString();
.addSql(type.getOperation(),"?")
.addParameter(toVectorLiteral(vector))
.toRequest()
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试过没

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试过了

@zhou-hao zhou-hao merged commit 07419bc into hs-web:4.2 Apr 2, 2026
1 check failed
@goten7 goten7 deleted the feat-4.2-pg-vector branch April 2, 2026 10:40
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.

2 participants