Skip to content

Commit 4d387f3

Browse files
fix: escape table names to avoid the sqlite error: near "-": syntax error". (#762) (#763)
Co-authored-by: OpenIM-Gordon <[email protected]>
1 parent 1beb991 commit 4d387f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/db/chat_log_model.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ func (d *DataBase) initChatLog(ctx context.Context, conversationID string) error
3737
tableName := utils.GetTableName(conversationID)
3838
if !d.tableChecker.HasTable(tableName) {
3939
createTableSQL := fmt.Sprintf(`
40-
CREATE TABLE %s (
40+
CREATE TABLE "%s" (
4141
client_msg_id CHAR(64),
4242
server_msg_id CHAR(64),
4343
send_id CHAR(64),

0 commit comments

Comments
 (0)