%%{init: {'themeVariables': { 'fontSize': '12px'}}}%%
graph TD
    classDef path fill:#eee,stroke:#000,color:#000
    classDef plan fill:#fff,stroke-width:1px,color:#000
    classDef itemplan fill:#fff,stroke-width:2px,color:#000
    classDef unbatchedplan fill:#dff,stroke-width:1px,color:#000
    classDef sideeffectplan fill:#fcc,stroke-width:2px,color:#000
    classDef bucket fill:#f6f6f6,color:#000,stroke-width:2px,text-align:left


    %% plan dependencies
    PgSelect39[["PgSelect[39∈0] ➊<br />ᐸnullᐳ"]]:::plan
    Object13{{"Object[13∈0] ➊<br />ᐸ{pgSettings,withPgClient}ᐳ"}}:::plan
    Constant52{{"Constant[52∈0] ➊<br />ᐸ1ᐳ"}}:::plan
    Constant51{{"Constant[51∈0] ➊<br />ᐸ4ᐳ"}}:::plan
    Constant53{{"Constant[53∈0] ➊<br />ᐸ2ᐳ"}}:::plan
    Constant54{{"Constant[54∈0] ➊<br />ᐸ3ᐳ"}}:::plan
    Object13 & Constant52 & Constant51 & Constant52 & Constant53 & Constant54 --> PgSelect39
    PgSelect10[["PgSelect[10∈0] ➊<br />ᐸawaitᐳ"]]:::plan
    Object13 & Constant51 & Constant52 & Constant53 & Constant54 --> PgSelect10
    PgSelect22[["PgSelect[22∈0] ➊<br />ᐸcaseᐳ"]]:::plan
    Constant55{{"Constant[55∈0] ➊<br />ᐸ10ᐳ"}}:::plan
    Object13 & Constant55 & Constant55 & Constant55 & Constant55 --> PgSelect22
    PgSelect32[["PgSelect[32∈0] ➊<br />ᐸvalueOfᐳ"]]:::plan
    Constant56{{"Constant[56∈0] ➊<br />ᐸ8ᐳ"}}:::plan
    Constant57{{"Constant[57∈0] ➊<br />ᐸ6ᐳ"}}:::plan
    Object13 & Constant56 & Constant53 & Constant51 & Constant57 --> PgSelect32
    Access11{{"Access[11∈0] ➊<br />ᐸ2.pgSettingsᐳ"}}:::plan
    Access12{{"Access[12∈0] ➊<br />ᐸ2.withPgClientᐳ"}}:::plan
    Access11 & Access12 --> Object13
    __Value2["__Value[2∈0] ➊<br />ᐸcontextᐳ"]:::plan
    __Value2 --> Access11
    __Value2 --> Access12
    First14{{"First[14∈0] ➊"}}:::plan
    PgSelectRows15[["PgSelectRows[15∈0] ➊"]]:::plan
    PgSelectRows15 --> First14
    PgSelect10 --> PgSelectRows15
    PgSelectSingle16{{"PgSelectSingle[16∈0] ➊<br />ᐸawaitᐳ"}}:::plan
    First14 --> PgSelectSingle16
    PgClassExpression17{{"PgClassExpression[17∈0] ➊<br />ᐸ__await__.vᐳ"}}:::plan
    PgSelectSingle16 --> PgClassExpression17
    First24{{"First[24∈0] ➊"}}:::plan
    PgSelectRows25[["PgSelectRows[25∈0] ➊"]]:::plan
    PgSelectRows25 --> First24
    PgSelect22 --> PgSelectRows25
    PgSelectSingle26{{"PgSelectSingle[26∈0] ➊<br />ᐸcaseᐳ"}}:::plan
    First24 --> PgSelectSingle26
    PgClassExpression27{{"PgClassExpression[27∈0] ➊<br />ᐸ__case__.vᐳ"}}:::plan
    PgSelectSingle26 --> PgClassExpression27
    First34{{"First[34∈0] ➊"}}:::plan
    PgSelectRows35[["PgSelectRows[35∈0] ➊"]]:::plan
    PgSelectRows35 --> First34
    PgSelect32 --> PgSelectRows35
    PgSelectSingle36{{"PgSelectSingle[36∈0] ➊<br />ᐸvalueOfᐳ"}}:::plan
    First34 --> PgSelectSingle36
    PgClassExpression37{{"PgClassExpression[37∈0] ➊<br />ᐸ__value_of__.vᐳ"}}:::plan
    PgSelectSingle36 --> PgClassExpression37
    First41{{"First[41∈0] ➊"}}:::plan
    PgSelectRows42[["PgSelectRows[42∈0] ➊"]]:::plan
    PgSelectRows42 --> First41
    PgSelect39 --> PgSelectRows42
    PgSelectSingle43{{"PgSelectSingle[43∈0] ➊<br />ᐸnullᐳ"}}:::plan
    First41 --> PgSelectSingle43
    __Value4["__Value[4∈0] ➊<br />ᐸrootValueᐳ"]:::plan
    PgClassExpression49{{"PgClassExpression[49∈1] ➊<br />ᐸ”js_reserv...lder! */<br />)ᐳ"}}:::plan
    PgSelectSingle43 --> PgClassExpression49
    PgClassExpression50{{"PgClassExpression[50∈1] ➊<br />ᐸ__null__.”break”ᐳ"}}:::plan
    PgSelectSingle43 --> PgClassExpression50

    %% define steps

    subgraph "Buckets for queries/v4/js-reserved-function-names"
    Bucket0("Bucket 0 (root)<br /><br />1: <br />ᐳ: 11, 12, 51, 52, 53, 54, 55, 56, 57, 13<br />2: 10, 22, 32, 39<br />3: 15, 25, 35, 42<br />ᐳ: 14, 16, 17, 24, 26, 27, 34, 36, 37, 41, 43"):::bucket
    classDef bucket0 stroke:#696969
    class Bucket0,__Value2,__Value4,PgSelect10,Access11,Access12,Object13,First14,PgSelectRows15,PgSelectSingle16,PgClassExpression17,PgSelect22,First24,PgSelectRows25,PgSelectSingle26,PgClassExpression27,PgSelect32,First34,PgSelectRows35,PgSelectSingle36,PgClassExpression37,PgSelect39,First41,PgSelectRows42,PgSelectSingle43,Constant51,Constant52,Constant53,Constant54,Constant55,Constant56,Constant57 bucket0
    Bucket1("Bucket 1 (nullableBoundary)<br />Deps: 43<br /><br />ROOT PgSelectSingleᐸnullᐳ[43]"):::bucket
    classDef bucket1 stroke:#00bfff
    class Bucket1,PgClassExpression49,PgClassExpression50 bucket1
    Bucket0 --> Bucket1
    end
