Skip to content

ema / @internals/db / ConversationDB

Interface: ConversationDB

Defined in: db/base.ts:259

Interface for conversation database operations

Methods

deleteConversation()

ts
deleteConversation(id): Promise<boolean>;

Defined in: db/base.ts:287

deletes a conversation from the database

Parameters

id

number

The unique identifier for the conversation to delete

Returns

Promise<boolean>

Promise resolving to true if deleted, false if not found


getConversation()

ts
getConversation(id): Promise<ConversationEntity | null>;

Defined in: db/base.ts:273

gets a conversation by id

Parameters

id

number

The unique identifier for the conversation

Returns

Promise<ConversationEntity | null>

Promise resolving to the conversation data or null if not found


listConversations()

ts
listConversations(req): Promise<ConversationEntity[]>;

Defined in: db/base.ts:264

Lists conversations in the database

Parameters

req

ListConversationsRequest

Returns

Promise<ConversationEntity[]>

Promise resolving to an array of conversation data


upsertConversation()

ts
upsertConversation(entity): Promise<number>;

Defined in: db/base.ts:280

inserts or updates a conversation in the database

Parameters

entity

ConversationEntity

The conversation data to upsert

Returns

Promise<number>

Promise resolving to the ID of the created or updated conversation