u
This commit is contained in:
34
src/providers/mssql/queries/modelmessage.js
Normal file
34
src/providers/mssql/queries/modelmessage.js
Normal file
@@ -0,0 +1,34 @@
|
||||
export const MODELMESSAGE_COLUMNS = `
|
||||
id,
|
||||
conversation_id,
|
||||
created_at,
|
||||
role,
|
||||
message
|
||||
`;
|
||||
|
||||
export const LIST_BY_CONVERSATION = `
|
||||
SELECT
|
||||
${MODELMESSAGE_COLUMNS}
|
||||
FROM modelmessage
|
||||
WHERE conversation_id = @conversationId
|
||||
ORDER BY id ASC
|
||||
`;
|
||||
|
||||
export const CREATE = `
|
||||
INSERT INTO modelmessage (
|
||||
conversation_id,
|
||||
role,
|
||||
message
|
||||
)
|
||||
OUTPUT
|
||||
INSERTED.id,
|
||||
INSERTED.conversation_id,
|
||||
INSERTED.created_at,
|
||||
INSERTED.role,
|
||||
INSERTED.message
|
||||
VALUES (
|
||||
@conversationId,
|
||||
@role,
|
||||
@message
|
||||
)
|
||||
`;
|
||||
Reference in New Issue
Block a user