mirror of
https://github.com/EthanMarti/infio-copilot.git
synced 2026-05-08 16:10:09 +00:00
update, use json database replace pglite, for sync
This commit is contained in:
@@ -32,7 +32,7 @@ export class CommandRepository {
|
||||
throw new DatabaseNotInitializedException()
|
||||
}
|
||||
const result = await this.db.query<SelectTemplate>(
|
||||
`SELECT * FROM "template"`
|
||||
`SELECT * FROM "template" ORDER BY created_at DESC`
|
||||
)
|
||||
return result.rows
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { App } from 'obsidian'
|
||||
import { Transaction } from '@electric-sql/pglite'
|
||||
import { App } from 'obsidian'
|
||||
|
||||
import { editorStateToPlainText } from '../../../components/chat-view/chat-input/utils/editor-state-to-plain-text'
|
||||
import { ChatAssistantMessage, ChatConversationMeta, ChatMessage, ChatUserMessage } from '../../../types/chat'
|
||||
@@ -77,6 +77,10 @@ export class ConversationManager {
|
||||
await this.repository.delete(id)
|
||||
}
|
||||
|
||||
async conversations(): Promise<SelectConversation[]>{
|
||||
return this.repository.findAll()
|
||||
}
|
||||
|
||||
getAllConversations(callback: (conversations: ChatConversationMeta[]) => void): void {
|
||||
const db = this.dbManager.getPgClient()
|
||||
db?.live.query('SELECT * FROM conversations ORDER BY updated_at DESC', [], (results: { rows: Array<SelectConversation> }) => {
|
||||
|
||||
Reference in New Issue
Block a user