|
2 | 2 | package com.microsoft.semantickernel.data.jdbc; |
3 | 3 |
|
4 | 4 | import com.microsoft.semantickernel.builders.SemanticKernelBuilder; |
5 | | -import com.microsoft.semantickernel.data.jdbc.mysql.MySQLVectorStoreQueryProvider; |
6 | | -import com.microsoft.semantickernel.data.jdbc.postgres.PostgreSQLVectorStoreQueryProvider; |
7 | | -import com.microsoft.semantickernel.data.jdbc.postgres.PostgreSQLVectorStoreRecordMapper; |
8 | 5 | import com.microsoft.semantickernel.data.vectorsearch.VectorSearchResults; |
9 | 6 | import com.microsoft.semantickernel.data.vectorstorage.VectorStoreRecordCollection; |
10 | 7 | import com.microsoft.semantickernel.data.vectorstorage.VectorStoreRecordMapper; |
@@ -73,25 +70,9 @@ public JDBCVectorStoreRecordCollection( |
73 | 70 |
|
74 | 71 | // If mapper is not provided, set a default one |
75 | 72 | if (options.getVectorStoreRecordMapper() == null) { |
76 | | - // Default mapper for PostgreSQL |
77 | | - if (this.queryProvider instanceof PostgreSQLVectorStoreQueryProvider) { |
78 | | - vectorStoreRecordMapper = PostgreSQLVectorStoreRecordMapper.<Record>builder() |
79 | | - .withRecordClass(options.getRecordClass()) |
80 | | - .withVectorStoreRecordDefinition(recordDefinition) |
81 | | - .build(); |
82 | | - // Default mapper for MySQL |
83 | | - } else if (this.queryProvider instanceof MySQLVectorStoreQueryProvider) { |
84 | | - vectorStoreRecordMapper = JDBCVectorStoreRecordMapper.<Record>builder() |
85 | | - .withRecordClass(options.getRecordClass()) |
86 | | - .withVectorStoreRecordDefinition(recordDefinition) |
87 | | - .build(); |
88 | | - // Default mapper for other databases |
89 | | - } else { |
90 | | - vectorStoreRecordMapper = JDBCVectorStoreRecordMapper.<Record>builder() |
91 | | - .withRecordClass(options.getRecordClass()) |
92 | | - .withVectorStoreRecordDefinition(recordDefinition) |
93 | | - .build(); |
94 | | - } |
| 73 | + vectorStoreRecordMapper = options.getQueryProvider() |
| 74 | + .getVectorStoreRecordMapper(options.getRecordClass(), |
| 75 | + recordDefinition); |
95 | 76 | } else { |
96 | 77 | vectorStoreRecordMapper = options.getVectorStoreRecordMapper(); |
97 | 78 | } |
|
0 commit comments