File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed
src/test/java/com/pgvector Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change 1717
1818public class JDBCJavaTest {
1919 @ Test
20- void testReadText () throws SQLException {
21- example (false );
20+ void testVectorReadText () throws SQLException {
21+ vectorExample (false );
2222 }
2323
2424 @ Test
25- void testReadBinary () throws SQLException {
26- example (true );
25+ void testVectorReadBinary () throws SQLException {
26+ vectorExample (true );
2727 }
2828
29- void example (boolean readBinary ) throws SQLException {
29+ void vectorExample (boolean readBinary ) throws SQLException {
3030 Connection conn = DriverManager .getConnection ("jdbc:postgresql://localhost:5432/pgvector_java_test" );
3131 if (readBinary ) {
3232 conn .unwrap (PGConnection .class ).setPrepareThreshold (-1 );
@@ -70,8 +70,20 @@ void example(boolean readBinary) throws SQLException {
7070 }
7171
7272 @ Test
73- void testHalfvec () throws SQLException {
73+ void testHalfvecReadText () throws SQLException {
74+ halfvecExample (false );
75+ }
76+
77+ @ Test
78+ void testHalfvecReadBinary () throws SQLException {
79+ halfvecExample (true );
80+ }
81+
82+ void halfvecExample (boolean readBinary ) throws SQLException {
7483 Connection conn = DriverManager .getConnection ("jdbc:postgresql://localhost:5432/pgvector_java_test" );
84+ if (readBinary ) {
85+ conn .unwrap (PGConnection .class ).setPrepareThreshold (-1 );
86+ }
7587
7688 Statement setupStmt = conn .createStatement ();
7789 setupStmt .executeUpdate ("CREATE EXTENSION IF NOT EXISTS vector" );
You can’t perform that action at this time.
0 commit comments