// Code generated by sqlc. DO NOT EDIT.
// versions:
//   sqlc v1.27.0

package database

import (
	"context"
	"database/sql"
)

type Querier interface {
	AddFavoriteFlow(ctx context.Context, arg AddFavoriteFlowParams) (UserPreference, error)
	CountAPITokens(ctx context.Context) (int64, error)
	CountActiveFlows(ctx context.Context) (int64, error)
	CountAssistants(ctx context.Context) (int64, error)
	CountContainers(ctx context.Context) (int64, error)
	CountFlowTemplates(ctx context.Context) (int64, error)
	CountFlows(ctx context.Context) (int64, error)
	CountPrompts(ctx context.Context) (int64, error)
	CountSubtasks(ctx context.Context) (int64, error)
	CountTasks(ctx context.Context) (int64, error)
	CountToolcalls(ctx context.Context) (int64, error)
	CountUsers(ctx context.Context) (int64, error)
	CreateAPIToken(ctx context.Context, arg CreateAPITokenParams) (ApiToken, error)
	CreateAgentLog(ctx context.Context, arg CreateAgentLogParams) (Agentlog, error)
	CreateAssistant(ctx context.Context, arg CreateAssistantParams) (Assistant, error)
	CreateAssistantLog(ctx context.Context, arg CreateAssistantLogParams) (Assistantlog, error)
	CreateContainer(ctx context.Context, arg CreateContainerParams) (Container, error)
	CreateFlow(ctx context.Context, arg CreateFlowParams) (Flow, error)
	CreateFlowTemplate(ctx context.Context, arg CreateFlowTemplateParams) (FlowTemplate, error)
	CreateMsgChain(ctx context.Context, arg CreateMsgChainParams) (Msgchain, error)
	CreateMsgLog(ctx context.Context, arg CreateMsgLogParams) (Msglog, error)
	CreateProvider(ctx context.Context, arg CreateProviderParams) (Provider, error)
	CreateResultAssistantLog(ctx context.Context, arg CreateResultAssistantLogParams) (Assistantlog, error)
	CreateResultMsgLog(ctx context.Context, arg CreateResultMsgLogParams) (Msglog, error)
	CreateScreenshot(ctx context.Context, arg CreateScreenshotParams) (Screenshot, error)
	CreateSearchLog(ctx context.Context, arg CreateSearchLogParams) (Searchlog, error)
	CreateSubtask(ctx context.Context, arg CreateSubtaskParams) (Subtask, error)
	CreateTask(ctx context.Context, arg CreateTaskParams) (Task, error)
	CreateTermLog(ctx context.Context, arg CreateTermLogParams) (Termlog, error)
	CreateToolcall(ctx context.Context, arg CreateToolcallParams) (Toolcall, error)
	CreateUser(ctx context.Context, arg CreateUserParams) (User, error)
	CreateUserPreferences(ctx context.Context, arg CreateUserPreferencesParams) (UserPreference, error)
	CreateUserPrompt(ctx context.Context, arg CreateUserPromptParams) (Prompt, error)
	CreateVectorStoreLog(ctx context.Context, arg CreateVectorStoreLogParams) (Vecstorelog, error)
	DeleteAPIToken(ctx context.Context, id int64) (ApiToken, error)
	DeleteAssistant(ctx context.Context, id int64) (Assistant, error)
	DeleteFavoriteFlow(ctx context.Context, arg DeleteFavoriteFlowParams) (UserPreference, error)
	DeleteFlow(ctx context.Context, id int64) (Flow, error)
	DeleteFlowAssistantLog(ctx context.Context, id int64) error
	// Delete all memory-type documents for a specific flow.
	// Called on flow deletion to free long-term memory that will never be re-used.
	// flow_id is the decimal text representation of the flow ID (e.g. "55"), matching the
	// text result of (cmetadata ->> 'flow_id') which uses JSON ->> extraction.
	DeleteFlowMemoryDocuments(ctx context.Context, flowID sql.NullString) error
	DeleteFlowTemplate(ctx context.Context, arg DeleteFlowTemplateParams) error
	// Delete a knowledge document by UUID (admin — no user_id check).
	DeleteKnowledgeDocument(ctx context.Context, uuid sql.NullString) error
	DeletePrompt(ctx context.Context, id int64) error
	DeleteProvider(ctx context.Context, id int64) (Provider, error)
	DeleteSubtask(ctx context.Context, id int64) error
	DeleteSubtasks(ctx context.Context, ids []int64) error
	DeleteUser(ctx context.Context, id int64) error
	DeleteUserAPIToken(ctx context.Context, arg DeleteUserAPITokenParams) (ApiToken, error)
	DeleteUserAPITokenByTokenID(ctx context.Context, arg DeleteUserAPITokenByTokenIDParams) (ApiToken, error)
	// Delete a knowledge document by UUID, only if it belongs to the given user.
	DeleteUserKnowledgeDocument(ctx context.Context, arg DeleteUserKnowledgeDocumentParams) error
	DeleteUserPreferences(ctx context.Context, userID int64) error
	DeleteUserPrompt(ctx context.Context, arg DeleteUserPromptParams) error
	// deleted_at IS NULL is load-bearing, not just hygiene: without it a replayed
	// delete of an already-deleted id still succeeds and still returns the row, and
	// the caller then resets every flow/assistant matching that name — which by
	// then may belong to a *different*, live provider reusing the freed name
	// (providers_name_user_id_unique is partial on deleted_at IS NULL). Mirrors the
	// guard GetUserProvider already applies on the rename path.
	DeleteUserProvider(ctx context.Context, arg DeleteUserProviderParams) (Provider, error)
	GetAPIToken(ctx context.Context, id int64) (ApiToken, error)
	GetAPITokenByTokenID(ctx context.Context, tokenID string) (ApiToken, error)
	GetAPITokens(ctx context.Context) ([]ApiToken, error)
	// Get toolcalls stats for all flows
	GetAllFlowsToolcallsStats(ctx context.Context) ([]GetAllFlowsToolcallsStatsRow, error)
	GetAllFlowsUsageStats(ctx context.Context) ([]GetAllFlowsUsageStatsRow, error)
	GetAllResourcesAll(ctx context.Context) ([]UserResource, error)
	GetAllResourcesInDir(ctx context.Context, arg GetAllResourcesInDirParams) ([]UserResource, error)
	GetAllResourcesRecursive(ctx context.Context, arg GetAllResourcesRecursiveParams) ([]UserResource, error)
	GetAllResourcesRoot(ctx context.Context) ([]UserResource, error)
	GetAssistant(ctx context.Context, id int64) (Assistant, error)
	GetAssistantUseAgents(ctx context.Context, id int64) (bool, error)
	// Get total count of assistants for a specific flow
	GetAssistantsCountForFlow(ctx context.Context, flowID int64) (int64, error)
	GetCallToolcall(ctx context.Context, callID string) (Toolcall, error)
	GetContainerTermLogs(ctx context.Context, containerID int64) ([]Termlog, error)
	GetContainers(ctx context.Context) ([]Container, error)
	GetFlow(ctx context.Context, id int64) (Flow, error)
	GetFlowAgentLog(ctx context.Context, arg GetFlowAgentLogParams) (Agentlog, error)
	GetFlowAgentLogs(ctx context.Context, flowID int64) ([]Agentlog, error)
	GetFlowAssistant(ctx context.Context, arg GetFlowAssistantParams) (Assistant, error)
	GetFlowAssistantLog(ctx context.Context, id int64) (Assistantlog, error)
	GetFlowAssistantLogs(ctx context.Context, arg GetFlowAssistantLogsParams) ([]Assistantlog, error)
	GetFlowAssistants(ctx context.Context, flowID int64) ([]Assistant, error)
	GetFlowContainers(ctx context.Context, flowID int64) ([]Container, error)
	GetFlowMsgChains(ctx context.Context, flowID int64) ([]Msgchain, error)
	GetFlowMsgLogs(ctx context.Context, flowID int64) ([]Msglog, error)
	GetFlowPrimaryContainer(ctx context.Context, flowID int64) (Container, error)
	GetFlowScreenshots(ctx context.Context, flowID int64) ([]Screenshot, error)
	GetFlowSearchLog(ctx context.Context, arg GetFlowSearchLogParams) (Searchlog, error)
	GetFlowSearchLogs(ctx context.Context, flowID int64) ([]Searchlog, error)
	// ==================== Flows Analytics Queries ====================
	// Get total count of tasks, subtasks, and assistants for a specific flow
	GetFlowStats(ctx context.Context, id int64) (GetFlowStatsRow, error)
	GetFlowSubtask(ctx context.Context, arg GetFlowSubtaskParams) (Subtask, error)
	GetFlowSubtasks(ctx context.Context, flowID int64) ([]Subtask, error)
	GetFlowTask(ctx context.Context, arg GetFlowTaskParams) (Task, error)
	GetFlowTaskSubtasks(ctx context.Context, arg GetFlowTaskSubtasksParams) ([]Subtask, error)
	GetFlowTaskTypeLastMsgChain(ctx context.Context, arg GetFlowTaskTypeLastMsgChainParams) (Msgchain, error)
	GetFlowTasks(ctx context.Context, flowID int64) ([]Task, error)
	GetFlowTemplate(ctx context.Context, arg GetFlowTemplateParams) (FlowTemplate, error)
	GetFlowTemplatesByUserID(ctx context.Context, userID int64) ([]FlowTemplate, error)
	GetFlowTermLogs(ctx context.Context, flowID int64) ([]Termlog, error)
	GetFlowToolcall(ctx context.Context, arg GetFlowToolcallParams) (Toolcall, error)
	GetFlowToolcalls(ctx context.Context, flowID int64) ([]Toolcall, error)
	// ==================== Toolcalls Analytics Queries ====================
	// Get total execution time and count of toolcalls for a specific flow
	GetFlowToolcallsStats(ctx context.Context, flowID int64) (GetFlowToolcallsStatsRow, error)
	GetFlowTypeMsgChains(ctx context.Context, arg GetFlowTypeMsgChainsParams) ([]Msgchain, error)
	GetFlowUsageStats(ctx context.Context, flowID int64) (GetFlowUsageStatsRow, error)
	GetFlowVectorStoreLog(ctx context.Context, arg GetFlowVectorStoreLogParams) (Vecstorelog, error)
	GetFlowVectorStoreLogs(ctx context.Context, flowID int64) ([]Vecstorelog, error)
	GetFlows(ctx context.Context) ([]Flow, error)
	// Flows created within the last N whole calendar days in the caller's timezone.
	GetFlowsForPeriod(ctx context.Context, arg GetFlowsForPeriodParams) ([]GetFlowsForPeriodRow, error)
	// One dense row per calendar day in the caller's timezone, zeros included.
	GetFlowsStatsByDay(ctx context.Context, arg GetFlowsStatsByDayParams) ([]GetFlowsStatsByDayRow, error)
	// Fetch a single knowledge document by its UUID (admin view — no user_id check).
	GetKnowledgeDocument(ctx context.Context, uuid string) (GetKnowledgeDocumentRow, error)
	GetMsgChain(ctx context.Context, id int64) (Msgchain, error)
	// Get all msgchains for a flow (including task and subtask level)
	GetMsgchainsForFlow(ctx context.Context, flowID int64) ([]GetMsgchainsForFlowRow, error)
	GetPrompts(ctx context.Context) ([]Prompt, error)
	GetProvider(ctx context.Context, id int64) (Provider, error)
	GetProviders(ctx context.Context) ([]Provider, error)
	GetProvidersByType(ctx context.Context, type_ ProviderType) ([]Provider, error)
	GetRole(ctx context.Context, id int64) (GetRoleRow, error)
	GetRoleByName(ctx context.Context, name string) (GetRoleByNameRow, error)
	GetRoles(ctx context.Context) ([]GetRolesRow, error)
	GetRunningContainers(ctx context.Context) ([]Container, error)
	GetScreenshot(ctx context.Context, id int64) (Screenshot, error)
	GetSubtask(ctx context.Context, id int64) (Subtask, error)
	GetSubtaskAgentLogs(ctx context.Context, subtaskID sql.NullInt64) ([]Agentlog, error)
	GetSubtaskMsgChains(ctx context.Context, subtaskID sql.NullInt64) ([]Msgchain, error)
	GetSubtaskMsgLogs(ctx context.Context, subtaskID sql.NullInt64) ([]Msglog, error)
	GetSubtaskPrimaryMsgChains(ctx context.Context, subtaskID sql.NullInt64) ([]Msgchain, error)
	GetSubtaskScreenshots(ctx context.Context, subtaskID sql.NullInt64) ([]Screenshot, error)
	GetSubtaskSearchLogs(ctx context.Context, subtaskID sql.NullInt64) ([]Searchlog, error)
	GetSubtaskTermLogs(ctx context.Context, subtaskID sql.NullInt64) ([]Termlog, error)
	GetSubtaskToolcalls(ctx context.Context, subtaskID sql.NullInt64) ([]Toolcall, error)
	// Get total execution time and count of toolcalls for a specific subtask
	GetSubtaskToolcallsStats(ctx context.Context, subtaskID sql.NullInt64) (GetSubtaskToolcallsStatsRow, error)
	GetSubtaskTypeMsgChains(ctx context.Context, arg GetSubtaskTypeMsgChainsParams) ([]Msgchain, error)
	GetSubtaskUsageStats(ctx context.Context, subtaskID sql.NullInt64) (GetSubtaskUsageStatsRow, error)
	GetSubtaskVectorStoreLogs(ctx context.Context, subtaskID sql.NullInt64) ([]Vecstorelog, error)
	// Get all subtasks for multiple tasks
	GetSubtasksForTasks(ctx context.Context, taskIds []int64) ([]GetSubtasksForTasksRow, error)
	// Number of configured providers per type, for the instance summary.
	GetSummaryProviderCounts(ctx context.Context) ([]GetSummaryProviderCountsRow, error)
	// Aggregate LLM usage per provider type, over the whole life of the instance,
	// for the instance summary.
	GetSummaryUsageByProvider(ctx context.Context) ([]GetSummaryUsageByProviderRow, error)
	GetTask(ctx context.Context, id int64) (Task, error)
	GetTaskAgentLogs(ctx context.Context, taskID sql.NullInt64) ([]Agentlog, error)
	GetTaskCompletedSubtasks(ctx context.Context, taskID int64) ([]Subtask, error)
	GetTaskMsgChains(ctx context.Context, taskID sql.NullInt64) ([]Msgchain, error)
	GetTaskMsgLogs(ctx context.Context, taskID sql.NullInt64) ([]Msglog, error)
	GetTaskPlannedSubtasks(ctx context.Context, taskID int64) ([]Subtask, error)
	GetTaskPrimaryMsgChainIDs(ctx context.Context, taskID sql.NullInt64) ([]GetTaskPrimaryMsgChainIDsRow, error)
	GetTaskPrimaryMsgChains(ctx context.Context, taskID sql.NullInt64) ([]Msgchain, error)
	GetTaskScreenshots(ctx context.Context, taskID sql.NullInt64) ([]Screenshot, error)
	GetTaskSearchLogs(ctx context.Context, taskID sql.NullInt64) ([]Searchlog, error)
	GetTaskSubtasks(ctx context.Context, taskID int64) ([]Subtask, error)
	GetTaskTermLogs(ctx context.Context, taskID sql.NullInt64) ([]Termlog, error)
	// Get total execution time and count of toolcalls for a specific task
	GetTaskToolcallsStats(ctx context.Context, taskID sql.NullInt64) (GetTaskToolcallsStatsRow, error)
	GetTaskTypeMsgChains(ctx context.Context, arg GetTaskTypeMsgChainsParams) ([]Msgchain, error)
	GetTaskUsageStats(ctx context.Context, taskID sql.NullInt64) (GetTaskUsageStatsRow, error)
	GetTaskVectorStoreLogs(ctx context.Context, taskID sql.NullInt64) ([]Vecstorelog, error)
	// Get all tasks for a flow
	GetTasksForFlow(ctx context.Context, flowID int64) ([]GetTasksForFlowRow, error)
	GetTermLog(ctx context.Context, id int64) (Termlog, error)
	// Get all toolcalls for a flow
	GetToolcallsForFlow(ctx context.Context, flowID int64) ([]GetToolcallsForFlowRow, error)
	// One dense row per calendar day in the caller's timezone, zeros included.
	GetToolcallsStatsByDay(ctx context.Context, arg GetToolcallsStatsByDayParams) ([]GetToolcallsStatsByDayRow, error)
	// Get toolcalls stats grouped by function name for a user
	GetToolcallsStatsByFunction(ctx context.Context, userID int64) ([]GetToolcallsStatsByFunctionRow, error)
	// Get toolcalls stats grouped by function name for a specific flow
	GetToolcallsStatsByFunctionForFlow(ctx context.Context, flowID int64) ([]GetToolcallsStatsByFunctionForFlowRow, error)
	// One dense row per calendar day in the caller's timezone, zeros included.
	GetUsageStatsByDay(ctx context.Context, arg GetUsageStatsByDayParams) ([]GetUsageStatsByDayRow, error)
	GetUsageStatsByModel(ctx context.Context, userID int64) ([]GetUsageStatsByModelRow, error)
	GetUsageStatsByModelAgentsForFlow(ctx context.Context, flowID int64) ([]GetUsageStatsByModelAgentsForFlowRow, error)
	GetUsageStatsByProvider(ctx context.Context, userID int64) ([]GetUsageStatsByProviderRow, error)
	GetUsageStatsByType(ctx context.Context, userID int64) ([]GetUsageStatsByTypeRow, error)
	GetUsageStatsByTypeForFlow(ctx context.Context, flowID int64) ([]GetUsageStatsByTypeForFlowRow, error)
	GetUser(ctx context.Context, id int64) (GetUserRow, error)
	GetUserAPIToken(ctx context.Context, arg GetUserAPITokenParams) (ApiToken, error)
	GetUserAPITokenByTokenID(ctx context.Context, arg GetUserAPITokenByTokenIDParams) (ApiToken, error)
	GetUserAPITokens(ctx context.Context, userID int64) ([]ApiToken, error)
	GetUserByHash(ctx context.Context, hash string) (GetUserByHashRow, error)
	GetUserContainers(ctx context.Context, userID int64) ([]Container, error)
	GetUserFlow(ctx context.Context, arg GetUserFlowParams) (Flow, error)
	GetUserFlowAgentLogs(ctx context.Context, arg GetUserFlowAgentLogsParams) ([]Agentlog, error)
	GetUserFlowAssistant(ctx context.Context, arg GetUserFlowAssistantParams) (Assistant, error)
	GetUserFlowAssistantLogs(ctx context.Context, arg GetUserFlowAssistantLogsParams) ([]Assistantlog, error)
	GetUserFlowAssistants(ctx context.Context, arg GetUserFlowAssistantsParams) ([]Assistant, error)
	GetUserFlowContainers(ctx context.Context, arg GetUserFlowContainersParams) ([]Container, error)
	GetUserFlowMsgLogs(ctx context.Context, arg GetUserFlowMsgLogsParams) ([]Msglog, error)
	GetUserFlowScreenshots(ctx context.Context, arg GetUserFlowScreenshotsParams) ([]Screenshot, error)
	GetUserFlowSearchLogs(ctx context.Context, arg GetUserFlowSearchLogsParams) ([]Searchlog, error)
	GetUserFlowSubtasks(ctx context.Context, arg GetUserFlowSubtasksParams) ([]Subtask, error)
	GetUserFlowTask(ctx context.Context, arg GetUserFlowTaskParams) (Task, error)
	GetUserFlowTaskSubtasks(ctx context.Context, arg GetUserFlowTaskSubtasksParams) ([]Subtask, error)
	GetUserFlowTasks(ctx context.Context, arg GetUserFlowTasksParams) ([]Task, error)
	GetUserFlowTermLogs(ctx context.Context, arg GetUserFlowTermLogsParams) ([]Termlog, error)
	GetUserFlowVectorStoreLogs(ctx context.Context, arg GetUserFlowVectorStoreLogsParams) ([]Vecstorelog, error)
	GetUserFlows(ctx context.Context, userID int64) ([]Flow, error)
	// Fetch a single knowledge document by UUID, scoped to a specific user.
	GetUserKnowledgeDocument(ctx context.Context, arg GetUserKnowledgeDocumentParams) (GetUserKnowledgeDocumentRow, error)
	GetUserPreferencesByUserID(ctx context.Context, userID int64) (UserPreference, error)
	GetUserPrompt(ctx context.Context, arg GetUserPromptParams) (Prompt, error)
	GetUserPromptByType(ctx context.Context, arg GetUserPromptByTypeParams) (Prompt, error)
	GetUserPrompts(ctx context.Context, userID int64) ([]Prompt, error)
	GetUserProvider(ctx context.Context, arg GetUserProviderParams) (Provider, error)
	GetUserProviderByName(ctx context.Context, arg GetUserProviderByNameParams) (Provider, error)
	GetUserProviders(ctx context.Context, userID int64) ([]Provider, error)
	GetUserProvidersByType(ctx context.Context, arg GetUserProvidersByTypeParams) ([]Provider, error)
	GetUserResourceByID(ctx context.Context, id int64) (UserResource, error)
	GetUserResourcesAll(ctx context.Context, userID int64) ([]UserResource, error)
	GetUserResourcesByIDs(ctx context.Context, ids []int64) ([]UserResource, error)
	GetUserResourcesInDir(ctx context.Context, arg GetUserResourcesInDirParams) ([]UserResource, error)
	GetUserResourcesRecursive(ctx context.Context, arg GetUserResourcesRecursiveParams) ([]UserResource, error)
	GetUserResourcesRoot(ctx context.Context, userID int64) ([]UserResource, error)
	// Get total count of flows, tasks, subtasks, and assistants for a user
	GetUserTotalFlowsStats(ctx context.Context, userID int64) (GetUserTotalFlowsStatsRow, error)
	// Get total toolcalls stats for a user
	GetUserTotalToolcallsStats(ctx context.Context, userID int64) (GetUserTotalToolcallsStatsRow, error)
	GetUserTotalUsageStats(ctx context.Context, userID int64) (GetUserTotalUsageStatsRow, error)
	GetUsers(ctx context.Context) ([]GetUsersRow, error)
	// Insert a document with a pre-computed embedding vector and return its UUID.
	// embedding must be formatted as a PostgreSQL vector literal: '[f1,f2,...]'
	// cmetadata must be valid JSON text.
	InsertKnowledgeDocument(ctx context.Context, arg InsertKnowledgeDocumentParams) (string, error)
	// List all knowledge documents excluding the noisy memory type (admin view).
	ListAllKnowledgeDocuments(ctx context.Context) ([]ListAllKnowledgeDocumentsRow, error)
	// List non-memory knowledge documents belonging to a specific flow (admin scoped).
	ListFlowKnowledgeDocuments(ctx context.Context, flowID sql.NullString) ([]ListFlowKnowledgeDocumentsRow, error)
	// List all non-memory knowledge documents owned by a specific user (user-scoped view).
	ListUserKnowledgeDocuments(ctx context.Context, userID sql.NullString) ([]ListUserKnowledgeDocumentsRow, error)
	SaveAssistantLog(ctx context.Context, arg SaveAssistantLogParams) error
	SaveAssistantLogContent(ctx context.Context, arg SaveAssistantLogContentParams) error
	// Vector similarity search over all knowledge documents (admin view, no user filter).
	// Returns rows ordered by cosine similarity descending (highest score first).
	// embedding    query vector as a PostgreSQL vector literal, e.g. '[0.1,0.2,...]'
	// max_distance cosine-distance upper bound (exclusive); equals (1 - score_threshold),
	//              e.g. pass 0.8 to get documents with similarity score > 0.2
	// lim          maximum number of rows to return
	SearchKnowledgeDocuments(ctx context.Context, arg SearchKnowledgeDocumentsParams) ([]SearchKnowledgeDocumentsRow, error)
	// Vector similarity search scoped to a specific user (by cmetadata user_id).
	// Returns rows ordered by cosine similarity descending (highest score first).
	// embedding    query vector as a PostgreSQL vector literal, e.g. '[0.1,0.2,...]'
	// max_distance cosine-distance upper bound (exclusive); equals (1 - score_threshold)
	// lim          maximum number of rows to return
	// user_id      owner filter as a decimal text string (e.g. "42")
	SearchUserKnowledgeDocuments(ctx context.Context, arg SearchUserKnowledgeDocumentsParams) ([]SearchUserKnowledgeDocumentsRow, error)
	UpdateAPIToken(ctx context.Context, arg UpdateAPITokenParams) (ApiToken, error)
	UpdateAssistant(ctx context.Context, arg UpdateAssistantParams) (Assistant, error)
	UpdateAssistantLanguage(ctx context.Context, arg UpdateAssistantLanguageParams) (Assistant, error)
	UpdateAssistantLog(ctx context.Context, arg UpdateAssistantLogParams) (Assistantlog, error)
	UpdateAssistantLogContent(ctx context.Context, arg UpdateAssistantLogContentParams) (Assistantlog, error)
	UpdateAssistantLogResult(ctx context.Context, arg UpdateAssistantLogResultParams) (Assistantlog, error)
	UpdateAssistantModel(ctx context.Context, arg UpdateAssistantModelParams) (Assistant, error)
	UpdateAssistantStatus(ctx context.Context, arg UpdateAssistantStatusParams) (Assistant, error)
	UpdateAssistantTitle(ctx context.Context, arg UpdateAssistantTitleParams) (Assistant, error)
	UpdateAssistantToolCallIDTemplate(ctx context.Context, arg UpdateAssistantToolCallIDTemplateParams) (Assistant, error)
	UpdateAssistantUseAgents(ctx context.Context, arg UpdateAssistantUseAgentsParams) (Assistant, error)
	// The assistants counterpart of UpdateFlowsProviderNameByOldName. Assistants
	// carry their own provider reference, independent of their flow's, and the
	// table has no user_id — ownership is derived by joining through flows, so the
	// statement can never cross a tenant boundary. Idempotent for the same reason:
	// a rewritten row no longer matches old_name.
	UpdateAssistantsProviderNameByOldName(ctx context.Context, arg UpdateAssistantsProviderNameByOldNameParams) ([]Assistant, error)
	UpdateContainerImage(ctx context.Context, arg UpdateContainerImageParams) (Container, error)
	UpdateContainerStatus(ctx context.Context, arg UpdateContainerStatusParams) (Container, error)
	UpdateContainerStatusLocalID(ctx context.Context, arg UpdateContainerStatusLocalIDParams) (Container, error)
	UpdateFlow(ctx context.Context, arg UpdateFlowParams) (Flow, error)
	UpdateFlowLanguage(ctx context.Context, arg UpdateFlowLanguageParams) (Flow, error)
	UpdateFlowProvider(ctx context.Context, arg UpdateFlowProviderParams) (Flow, error)
	UpdateFlowStatus(ctx context.Context, arg UpdateFlowStatusParams) (Flow, error)
	UpdateFlowTemplate(ctx context.Context, arg UpdateFlowTemplateParams) (FlowTemplate, error)
	UpdateFlowTitle(ctx context.Context, arg UpdateFlowTitleParams) (Flow, error)
	UpdateFlowToolCallIDTemplate(ctx context.Context, arg UpdateFlowToolCallIDTemplateParams) (Flow, error)
	// Bulk-renames every flow row of a user still pointing at a provider's old name
	// (the user renamed a custom LLM provider, or deleted one and the reference is
	// reset to the built-in name of its type). Matching on old_name makes the
	// statement idempotent: once rewritten, a row no longer matches, so it is safe
	// to call unconditionally and to retry.
	UpdateFlowsProviderNameByOldName(ctx context.Context, arg UpdateFlowsProviderNameByOldNameParams) ([]Flow, error)
	// Update an existing document's embedding, text and metadata atomically.
	// embedding must be formatted as a PostgreSQL vector literal: '[f1,f2,...]'
	// cmetadata must be valid JSON text.
	UpdateKnowledgeDocument(ctx context.Context, arg UpdateKnowledgeDocumentParams) (UpdateKnowledgeDocumentRow, error)
	// Update only the document's metadata, leaving its text and embedding intact.
	// Used when an update changes no content (e.g. rename) so re-embedding — and
	// therefore a configured embedder — is unnecessary.
	// cmetadata must be valid JSON text.
	UpdateKnowledgeDocumentMetadata(ctx context.Context, arg UpdateKnowledgeDocumentMetadataParams) (UpdateKnowledgeDocumentMetadataRow, error)
	UpdateMsgChain(ctx context.Context, arg UpdateMsgChainParams) (Msgchain, error)
	UpdateMsgChainUsage(ctx context.Context, arg UpdateMsgChainUsageParams) (Msgchain, error)
	UpdateMsgLogResult(ctx context.Context, arg UpdateMsgLogResultParams) (Msglog, error)
	UpdatePrompt(ctx context.Context, arg UpdatePromptParams) (Prompt, error)
	UpdateProvider(ctx context.Context, arg UpdateProviderParams) (Provider, error)
	UpdateSubtaskContext(ctx context.Context, arg UpdateSubtaskContextParams) (Subtask, error)
	UpdateSubtaskFailedResult(ctx context.Context, arg UpdateSubtaskFailedResultParams) (Subtask, error)
	UpdateSubtaskFinishedResult(ctx context.Context, arg UpdateSubtaskFinishedResultParams) (Subtask, error)
	UpdateSubtaskResult(ctx context.Context, arg UpdateSubtaskResultParams) (Subtask, error)
	UpdateSubtaskStatus(ctx context.Context, arg UpdateSubtaskStatusParams) (Subtask, error)
	UpdateTaskFailedResult(ctx context.Context, arg UpdateTaskFailedResultParams) (Task, error)
	UpdateTaskFinishedResult(ctx context.Context, arg UpdateTaskFinishedResultParams) (Task, error)
	UpdateTaskResult(ctx context.Context, arg UpdateTaskResultParams) (Task, error)
	UpdateTaskStatus(ctx context.Context, arg UpdateTaskStatusParams) (Task, error)
	UpdateToolcallFailedResult(ctx context.Context, arg UpdateToolcallFailedResultParams) (Toolcall, error)
	UpdateToolcallFinishedResult(ctx context.Context, arg UpdateToolcallFinishedResultParams) (Toolcall, error)
	UpdateToolcallStatus(ctx context.Context, arg UpdateToolcallStatusParams) (Toolcall, error)
	UpdateUserAPIToken(ctx context.Context, arg UpdateUserAPITokenParams) (ApiToken, error)
	UpdateUserName(ctx context.Context, arg UpdateUserNameParams) (User, error)
	UpdateUserPassword(ctx context.Context, arg UpdateUserPasswordParams) (User, error)
	UpdateUserPasswordChangeRequired(ctx context.Context, arg UpdateUserPasswordChangeRequiredParams) (User, error)
	UpdateUserPreferences(ctx context.Context, arg UpdateUserPreferencesParams) (UserPreference, error)
	UpdateUserPrompt(ctx context.Context, arg UpdateUserPromptParams) (Prompt, error)
	UpdateUserPromptByType(ctx context.Context, arg UpdateUserPromptByTypeParams) (Prompt, error)
	UpdateUserProvider(ctx context.Context, arg UpdateUserProviderParams) (Provider, error)
	UpdateUserRole(ctx context.Context, arg UpdateUserRoleParams) (User, error)
	UpdateUserStatus(ctx context.Context, arg UpdateUserStatusParams) (User, error)
	UpsertUserPreferences(ctx context.Context, arg UpsertUserPreferencesParams) (UserPreference, error)
}

var _ Querier = (*Queries)(nil)
