prorm API Reference
    Preparing search index...

    Class Neo4jGraphDialect

    Abstract base class for database dialects Provides common functionality for all dialect implementations

    Hierarchy (View Summary)

    Index
    createProcedure dropProcedure renameColumn addForeignKey bulkInsert createFulltextIndex createSpatialIndex listSchemas createDatabaseSQL dropDatabaseSQL createSavepointSQL releaseSavepointSQL rollbackToSavepointSQL createExtension dropExtension getExtensions hasExtension createEnumType dropType createDomain dropDomain buildCreateServerQuery buildAlterServerQuery buildDropServerQuery buildCreateUserMappingQuery buildAlterUserMappingQuery buildDropUserMappingQuery createUserMapping dropUserMapping buildCreateForeignTableQuery buildDropForeignTableQuery buildImportForeignSchemaQuery getServersQuery buildCreateUserQuery buildAlterUserQuery buildDropUserQuery getUsersQuery buildGrantQuery buildRevokeQuery buildShowGrantsQuery buildFlushPrivilegesQuery buildCreateRoleQuery buildDropRoleQuery buildGrantRoleQuery buildRevokeRoleQuery getRolesQuery buildJsonQuery formatValue formatDate replaceReplacements replacePositionalReplacements replaceNamedReplacements escapeReplacement parseValue getIsolationLevelSql resolveAllInclude generateSelectColumns flattenIncludesWithAll getConnection isConnected queryStream escape escapeId quoteIdentifier quoteTable getDataTypeSql run paramValues requireRandomOrderTerm normalizeOrder mapIncludes buildWhereClause buildOrderClause buildLimitOffset buildInsertQuery buildUpdateQuery buildDeleteQuery buildSelectQuery buildUpsertQuery buildIncrementQuery identityKeys createTable dropTable addIndex createIndex removeIndex dropIndex createConstraint dropConstraint addConstraint removeConstraint showTables showViews showMaterializedViews showConstraints showIndexes describeTable createSchema dropSchema showAllSchemas addColumn removeColumn changeColumn commentTable commentColumn defineNode defineEdge createNode findNodes updateNodes destroyNodes relate traverse createPartitionedTable createPartition attachPartition detachPartition dropPartition createView dropView createMaterializedView refreshMaterializedView dropMaterializedView hasMaterializedView createStoredProcedure dropStoredProcedure executeStoredProcedure hasStoredProcedure createTrigger dropTrigger hasTrigger createSequence dropSequence nextSequenceValue hasSequence createPolicy dropPolicy enableRLS disableRLS hasPolicy createPartialIndex createExpressionIndex createIdentityColumn createComputedColumn renameTable changeOwner createForeignDataWrapper dropForeignDataWrapper createForeignServer dropForeignServer createForeignTable createSecurityPolicy dropSecurityPolicy randomOrderTerm connect disconnect query getDatabaseVersion startTransaction commitTransaction rollbackTransaction renderPredicate compileMatch compileCreateNode compileUpdateNodes compileDeleteNodes compileUpsertNode compileIncrement compileCreateEdge compileTraverse compileCreateConstraint compileDropConstraint compileCreateIndex compileDropIndex compileShowLabels
    _connection: any = null
    _connected: boolean = false
    dialectName: string = 'unknown'
    nodeModels: Map<string, NodeModelDefinition> = ...

    In-memory registry of node/edge models defined through the builder.

    edgeModels: Map<string, EdgeModelDefinition> = ...
    name: "neo4j" = 'neo4j'

    The name of the dialect

    library: "neo4j-driver" = 'neo4j-driver'

    The database library or driver being used

    • get defaultNodeVar(): string

      Variable name node properties are addressed through in generated queries.

      Returns string

    • Rename a column (default throws error)

      Parameters

      • _tableName: string
      • _oldColumnName: string
      • _newColumnName: string

      Returns Promise<void>

    • Add a foreign key (default throws error)

      Parameters

      • _tableName: string
      • _columnName: string
      • _referencedTableName: string
      • _referencedColumnName: string
      • Optional_options: any

      Returns Promise<void>

    • Create a fulltext index (default throws error)

      Parameters

      • _tableName: string
      • _indexName: string
      • _fields: string[]
      • Optional_options: { parser?: string; comment?: string }

      Returns Promise<void>

    • Create a spatial index (default throws error)

      Parameters

      • _tableName: string
      • _indexName: string
      • _fields: string[]
      • Optional_options: { storage?: string; srid?: number }

      Returns Promise<void>

    • Generate SQL for creating a database (default implementation)

      Parameters

      • options: {
            name: string;
            encoding?: string;
            lcCollate?: string;
            lcCtype?: string;
            template?: string;
            tablespace?: string;
            collate?: string;
            isTemplate?: boolean;
        }

        Database creation options

      Returns string

    • Check if a PostgreSQL extension is installed (only supported in PostgreSQL)

      Parameters

      • _extensionName: string

      Returns Promise<boolean>

      True if the extension is installed

    • Create a user mapping (default throws error)

      Parameters

      • _userName: string
      • _serverName: string
      • Optional_options: any

      Returns Promise<void>

    • Drop a user mapping (default throws error)

      Parameters

      • _userName: string
      • _serverName: string
      • Optional_options: any

      Returns Promise<void>

    • Build a JSON/JSONB path query Default implementation using common JSON extraction syntax

      Parameters

      • column: string

        The JSON/JSONB column name

      • path: string

        The JSON path to access (e.g., 'key' or 'key.subkey')

      • Optionalvalue: unknown

        The value to compare against (optional)

      • operator: string = '='

        The comparison operator to use (defaults to =)

      Returns { sql: string; values: unknown[] }

      SQL fragment and values for the JSON query

    • Replace placeholders in SQL with actual values Supports both named (:param) and positional (?) placeholders Properly escapes values to prevent SQL injection

      Parameters

      • sql: string
      • Optionalreplacements: unknown[] | Record<string, unknown>

      Returns string

    • Replace named (:param) placeholders with escaped values

      Parameters

      • sql: string
      • replacements: Record<string, unknown>

      Returns string

    • Generate column list with proper aliasing to avoid duplicates

      Parameters

      • mainTableName: string
      • mainTableAlias: string
      • Optionalattributes: string[] | { include?: string[]; exclude?: string[] }
      • Optionalincludes: { tableName: string; alias: string }[]

      Returns string

    • Object-mode streaming: runs the query and pushes one row (or mapped model instance) per chunk. Graph drivers don't share a common cursor API, so this buffers the driver result and re-emits it — correct and dialect-agnostic, matching the Model.findAllStream() contract.

      Parameters

      Returns Readable

    • Quote a table name

      Parameters

      • tableName: string

        The table name to quote

      • Optional_schema: string

        Optional schema to prefix the table with

      Returns string

    • Tolerant Order -> [field, dir][] normalizer.

      Also understands the asc() / desc() / random() order helpers from src/operators.ts. They arrive as plain OrderExpression objects, so without an explicit branch they fell through the $col/column check below and were dropped silently — the helpers simply did nothing on every graph dialect. random() becomes a 'RANDOM' term with no field, which each compile* translates (or refuses) in its own language.

      Parameters

      Returns GraphOrderTerm[]

    • Build an increment query

      Parameters

      • tableName: string

        Table name

      • fields: string | string[] | Record<string, number>

        Fields to increment

      • where: WhereOptions

        Where clause

      • Optionaloptions: { by?: number }

        Query options (by: number)

      Returns { sql: string; values: any[] }

    • "CREATE TABLE" for a graph store = declare a node label and materialize its schema hints: unique/primary-key columns become uniqueness constraints, references columns become association edges, and indexed columns become property indexes. Nodes themselves stay schemaless.

      Parameters

      Returns Promise<void>

    • Add an index to a table

      Parameters

      • tableName: string

        Name of the table

      • indexName: string

        Name of the index

      • fields: string[]

        Fields to index

      • Optional_options: IndexOptions

        Index options

      Returns Promise<void>

    • Add a constraint to a table

      Parameters

      • tableName: string
      • options: {
            type: "UNIQUE" | "PRIMARY KEY" | "FOREIGN KEY" | "CHECK";
            fields: string[];
            name?: string;
            references?: { table: string; fields: string[] };
            check?: string;
        }

      Returns Promise<void>

    • Remove a column from a table

      Parameters

      • tableName: string

        Name of the table

      • columnName: string

        Name of the column to remove

      Returns Promise<void>

    • Add comment to a column

      Parameters

      • _tableName: string
      • _columnName: string
      • _comment: string

      Returns Promise<void>

    • Check if a stored procedure exists

      Parameters

      • _procedureName: string
      • Optional_schema: string

      Returns Promise<boolean>

      True if the stored procedure exists

    • Check if a trigger exists

      Parameters

      • _triggerName: string
      • _tableName: string

      Returns Promise<boolean>

      True if the trigger exists

    • Check if a policy exists (PostgreSQL RLS)

      Parameters

      • _policyName: string
      • _tableName: string

      Returns Promise<boolean>

      True if the policy exists