Member Junction
    Preparing search index...

    Minimal dialect interface consumed by @memberjunction/sql-parser.

    SQLParser needs only these properties to be dialect-aware. The full SQLDialect class implements this interface plus 80+ additional methods for DDL/DML generation, data type mapping, etc.

    When adding a new database platform, implement at minimum this interface for parser support. Implement the full SQLDialect for complete MJ support.

    interface SQLParserDialect {
        AllowsOrderByInCTE: boolean;
        CallerSQLForbiddenFunctions: readonly string[];
        DefaultPagingOrderBy: string;
        ParserDialect: string;
        QueryHintKeyword: string | null;
        SupportsDollarQuotedStrings: boolean;
        SupportsEscapeStringLiterals: boolean;
        QuoteIdentifier(name: string): string;
    }

    Implemented by

    Index

    Properties

    AllowsOrderByInCTE: boolean

    Whether ORDER BY is legal inside CTE definitions on this platform

    CallerSQLForbiddenFunctions: readonly string[]

    Functions SQL a caller supplied (ad-hoc SQL, TestQuerySQL, query specs, client RunView clauses) may not call, lower case; a trailing * matches every name with that prefix. They run SQL passed as a string, read files or other databases, act on the server, or pause the query, so neither the check of which tables the SQL reads nor a read-only transaction stops them.

    DefaultPagingOrderBy: string

    Default ORDER BY expression for paging when no ORDER BY exists. SQL Server: '(SELECT NULL)', PostgreSQL: '1'

    ParserDialect: string

    node-sql-parser dialect string (e.g., 'TransactSQL', 'PostgresQL', 'MySQL')

    QueryHintKeyword: string | null

    The keyword that opens a statement's trailing query-hint clause, such as OPTION (…); null when the platform has none. SQL Server: 'OPTION', PostgreSQL: null

    SupportsDollarQuotedStrings: boolean

    Whether dollar-quoted string literals ($$…$$, $tag$…$tag$) exist. PostgreSQL: true, SQL Server: false

    SupportsEscapeStringLiterals: boolean

    Whether E'…' string literals, in which a backslash escapes the next character, exist. PostgreSQL: true, SQL Server: false

    Methods

    • Quotes a database identifier. SQL Server: [name], PostgreSQL: "name", MySQL: name

      Parameters

      • name: string

      Returns string