Base interface for query information shared between MJCore and external systems. Contains the core metadata needed to understand and execute stored queries.

interface IQueryInfoBase {
    CacheEnabled: boolean;
    CacheMaxSize: number;
    CacheTTLMinutes: number;
    CacheValidationSQL: string;
    Category: string;
    CategoryID: string;
    CategoryPath: string;
    Description: string;
    EmbeddingModelID?: string;
    EmbeddingModelName?: string;
    EmbeddingVector?: string;
    Entities?: IQueryEntityInfoBase[];
    Fields: IQueryFieldInfoBase[];
    ID: string;
    Name: string;
    Parameters: IQueryParameterInfoBase[];
    QualityRank: number;
    SQL: string;
    Status: "Pending" | "In-Review" | "Approved" | "Rejected" | "Obsolete";
}

Implemented by

Properties

CacheEnabled: boolean

When true, query results will be cached in memory with TTL expiration

CacheMaxSize: number

Maximum number of cached result sets for this query. NULL uses default size limit.

CacheTTLMinutes: number

Time-to-live in minutes for cached query results. NULL uses default TTL.

CacheValidationSQL: string

SQL query that returns cache validation fingerprint data (MaxUpdatedAt, RowCount). Used for smart cache refresh to determine if cached data is stale.

Category: string

Category name from the related Query Categories entity

CategoryID: string

Foreign key reference to the Query Categories entity

CategoryPath: string

Full hierarchical path of the category (e.g., "/MJ/AI/Agents/")

Description: string

Detailed description of what the query does and what data it returns

EmbeddingModelID?: string

The AI Model ID used to generate the embedding vector

EmbeddingModelName?: string

The AI Model name used to generate the embedding vector

EmbeddingVector?: string

Optional JSON-serialized embedding vector for similarity search

Entities referenced by this query

Field metadata for this query

ID: string

Unique identifier for the query record

Name: string

Name of the query for display and reference

Parameter definitions for this parameterized query

QualityRank: number

Value indicating the quality of the query, higher values mean better quality

SQL: string

The actual SQL query text to execute, may include Nunjucks template parameters

Status: "Pending" | "In-Review" | "Approved" | "Rejected" | "Obsolete"

Current status of the query in the approval workflow