Skip to content

Commit dbfda30

Browse files
committed
fix table name for better queries
1 parent 70b8640 commit dbfda30

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

client/packages/lowcoder/src/comps/comps/chatComp/chatComp.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,4 +253,5 @@ const handleConversationUpdate = (conversationHistory: any[]) => {
253253
export const ChatComp = withExposingConfigs(ChatTmpComp, [
254254
new NameConfig("currentMessage", "Current user message"),
255255
new NameConfig("conversationHistory", "Full conversation history as JSON array (includes system prompt for API calls)"),
256+
new NameConfig("databaseName", "Database name for SQL queries (ChatDB_<componentName>)"),
256257
]);

client/packages/lowcoder/src/comps/comps/chatComp/utils/storageFactory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { ChatMessage, ChatThread, ChatStorage } from "../types/chatTypes";
99

1010
export function createChatStorage(tableName: string): ChatStorage {
1111
const dbName = `ChatDB_${tableName}`;
12-
const threadsTable = `${dbName}.${tableName}_threads`;
13-
const messagesTable = `${dbName}.${tableName}_messages`;
12+
const threadsTable = `${dbName}.threads`;
13+
const messagesTable = `${dbName}.messages`;
1414

1515
return {
1616
async initialize() {

0 commit comments

Comments
 (0)