Skip to content

Commit edd12b9

Browse files
committed
Fix primary key no use
1 parent dc87247 commit edd12b9

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

chat2db-server/chat2db-spi/src/main/java/ai/chat2db/spi/enums/DataTypeEnum.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ public static DataTypeEnum getByCode(String code) {
108108

109109
public String getSqlValue(String value) {
110110
if (this == DataTypeEnum.BOOLEAN) {
111-
return value;
111+
if("true".equalsIgnoreCase(value) || "false".equalsIgnoreCase(value)){
112+
return value;
113+
}else {
114+
return "'" + value + "'";
115+
}
112116
}
113117
if (this == DataTypeEnum.NUMERIC) {
114118
return value;
@@ -149,9 +153,6 @@ public String getSqlValue(String value) {
149153
if (this == DataTypeEnum.UNKNOWN) {
150154
return "'" + value + "'";
151155
}
152-
if (this == DataTypeEnum.CHAT2DB_ROW_NUMBER) {
153-
return "'" + value + "'";
154-
}
155156
return "'" + value + "'";
156157
}
157158
}

0 commit comments

Comments
 (0)