---
source: crates/squawk_parser/tests/tests.rs
input_file: crates/squawk_parser/tests/data/ok/create_index.sql
---
SOURCE_FILE
  COMMENT "-- create_index"
  WHITESPACE "\n"
  COMMENT "-- simple"
  WHITESPACE "\n"
  CREATE_INDEX
    CREATE_KW "create"
    WHITESPACE " "
    INDEX_KW "index"
    WHITESPACE " "
    ON_KW "on"
    WHITESPACE " "
    RELATION_NAME
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "t"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      PARTITION_ITEM
        NAME_REF
          IDENT "c"
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- more options"
  WHITESPACE "\n"
  CREATE_INDEX
    CREATE_KW "create"
    WHITESPACE " "
    UNIQUE_KW "unique"
    WHITESPACE " "
    INDEX_KW "index"
    WHITESPACE " "
    CONCURRENTLY_KW "concurrently"
    WHITESPACE " \n  "
    IF_NOT_EXISTS
      IF_KW "if"
      WHITESPACE " "
      NOT_KW "not"
      WHITESPACE " "
      EXISTS_KW "exists"
    WHITESPACE " "
    NAME
      IDENT "i"
    WHITESPACE " \n  "
    ON_KW "on"
    WHITESPACE " "
    RELATION_NAME
      ONLY_KW "only"
      WHITESPACE " "
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "t"
    WHITESPACE " \n  "
    USING_METHOD
      USING_KW "using"
      WHITESPACE " "
      NAME_REF
        IDENT "bar"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      PARTITION_ITEM
        NAME_REF
          IDENT "c"
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- column options"
  WHITESPACE "\n"
  CREATE_INDEX
    CREATE_KW "create"
    WHITESPACE " "
    INDEX_KW "index"
    WHITESPACE " "
    ON_KW "on"
    WHITESPACE " "
    RELATION_NAME
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "t"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      PARTITION_ITEM
        BIN_EXPR
          NAME_REF
            IDENT "c"
          WHITESPACE " "
          COLLATE_KW "collate"
          WHITESPACE " "
          NAME_REF
            IDENT "\"fr_FR\""
        WHITESPACE " "
        SORT_ASC
          ASC_KW "asc"
        WHITESPACE " "
        NULLS_LAST
          NULLS_KW "nulls"
          WHITESPACE " "
          LAST_KW "last"
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n"
  CREATE_INDEX
    CREATE_KW "create"
    WHITESPACE " "
    INDEX_KW "index"
    WHITESPACE " "
    ON_KW "on"
    WHITESPACE " "
    RELATION_NAME
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "t"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      PARTITION_ITEM
        NAME_REF
          IDENT "c"
        WHITESPACE " "
        SORT_DESC
          DESC_KW "desc"
        WHITESPACE " "
        NULLS_FIRST
          NULLS_KW "nulls"
          WHITESPACE " "
          FIRST_KW "first"
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- opclass"
  WHITESPACE "\n"
  CREATE_INDEX
    CREATE_KW "create"
    WHITESPACE " "
    INDEX_KW "index"
    WHITESPACE " "
    ON_KW "on"
    WHITESPACE " "
    RELATION_NAME
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "t"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      WHITESPACE "\n  "
      PARTITION_ITEM
        NAME_REF
          IDENT "a"
        WHITESPACE " "
        IDENT "text_pattern_ops"
        WHITESPACE " "
        ATTRIBUTE_LIST
          L_PAREN "("
          ATTRIBUTE_OPTION
            NAME
              IDENT "strength"
            WHITESPACE " "
            EQ "="
            WHITESPACE " "
            ATTRIBUTE_VALUE
              PRIMARY_KW "primary"
          COMMA ","
          WHITESPACE " "
          ATTRIBUTE_OPTION
            NAME
              IDENT "variant"
            WHITESPACE " "
            EQ "="
            WHITESPACE " "
            ATTRIBUTE_VALUE
              DEFAULT_KW "default"
          R_PAREN ")"
      COMMA ","
      WHITESPACE "\n  "
      PARTITION_ITEM
        NAME_REF
          IDENT "b"
        WHITESPACE " "
        IDENT "text_pattern_ops"
        WHITESPACE " "
        ATTRIBUTE_LIST
          L_PAREN "("
          ATTRIBUTE_OPTION
            NAME
              IDENT "strength"
            WHITESPACE " "
            EQ "="
            WHITESPACE " "
            ATTRIBUTE_VALUE
              PRIMARY_KW "primary"
          R_PAREN ")"
      WHITESPACE "\n"
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- column expr"
  WHITESPACE "\n"
  CREATE_INDEX
    CREATE_KW "create"
    WHITESPACE " "
    INDEX_KW "index"
    WHITESPACE " "
    ON_KW "on"
    WHITESPACE " "
    RELATION_NAME
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "t"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      PARTITION_ITEM
        PAREN_EXPR
          L_PAREN "("
          BIN_EXPR
            CALL_EXPR
              NAME_REF
                IDENT "f"
              ARG_LIST
                L_PAREN "("
                NAME_REF
                  IDENT "c"
                R_PAREN ")"
            WHITESPACE " "
            PLUS "+"
            WHITESPACE " "
            LITERAL
              INT_NUMBER "2"
          R_PAREN ")"
      COMMA ","
      WHITESPACE " "
      PARTITION_ITEM
        NAME_REF
          IDENT "b"
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- trailing options"
  WHITESPACE "\n"
  CREATE_INDEX
    CREATE_KW "create"
    WHITESPACE " "
    INDEX_KW "index"
    WHITESPACE " "
    ON_KW "on"
    WHITESPACE " "
    RELATION_NAME
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "t"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      PARTITION_ITEM
        NAME_REF
          IDENT "c"
      R_PAREN ")"
    WHITESPACE "\n  "
    CONSTRAINT_INCLUDE_CLAUSE
      INCLUDE_KW "include"
      WHITESPACE " "
      COLUMN_LIST
        L_PAREN "("
        COLUMN
          NAME_REF
            IDENT "a"
        COMMA ","
        WHITESPACE " "
        COLUMN
          NAME_REF
            IDENT "b"
        R_PAREN ")"
    WHITESPACE "\n  "
    NULLS_NOT_DISTINCT
      NULLS_KW "nulls"
      WHITESPACE " "
      NOT_KW "not"
      WHITESPACE " "
      DISTINCT_KW "distinct"
    WHITESPACE "\n  "
    WITH_PARAMS
      WITH_KW "with"
      WHITESPACE " "
      ATTRIBUTE_LIST
        L_PAREN "("
        ATTRIBUTE_OPTION
          NAME
            IDENT "foo"
          WHITESPACE " "
          EQ "="
          WHITESPACE " "
          ATTRIBUTE_VALUE
            PATH_TYPE
              PATH
                PATH_SEGMENT
                  NAME_REF
                    IDENT "bar"
        COMMA ","
        WHITESPACE " "
        ATTRIBUTE_OPTION
          NAME
            IDENT "buzz"
        R_PAREN ")"
    WHITESPACE "\n  "
    TABLESPACE
      TABLESPACE_KW "tablespace"
      WHITESPACE " "
      NAME_REF
        IDENT "space"
    WHITESPACE "\n  "
    WHERE_CLAUSE
      WHERE_KW "where"
      WHITESPACE " "
      BIN_EXPR
        NAME_REF
          IDENT "x"
        WHITESPACE " "
        R_ANGLE ">"
        WHITESPACE " "
        LITERAL
          INT_NUMBER "10"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  CREATE_INDEX
    CREATE_KW "create"
    WHITESPACE " "
    INDEX_KW "index"
    WHITESPACE " "
    ON_KW "on"
    WHITESPACE " "
    RELATION_NAME
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "t"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      PARTITION_ITEM
        NAME_REF
          IDENT "c"
      R_PAREN ")"
    WHITESPACE "\n  "
    NULLS_DISTINCT
      NULLS_KW "nulls"
      WHITESPACE " "
      DISTINCT_KW "distinct"
    WHITESPACE "\n  "
    WHERE_CLAUSE
      WHERE_KW "where"
      WHITESPACE " "
      BIN_EXPR
        NAME_REF
          IDENT "x"
        WHITESPACE " "
        IS_NOT
          IS_KW "is"
          WHITESPACE " "
          NOT_KW "not"
        WHITESPACE " "
        LITERAL
          NULL_KW "null"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- schema"
  WHITESPACE "\n"
  CREATE_INDEX
    CREATE_KW "create"
    WHITESPACE " "
    INDEX_KW "index"
    WHITESPACE " "
    ON_KW "on"
    WHITESPACE " "
    RELATION_NAME
      PATH
        PATH
          PATH_SEGMENT
            NAME_REF
              IDENT "public"
        DOT "."
        PATH_SEGMENT
          NAME_REF
            IDENT "t"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      PARTITION_ITEM
        NAME_REF
          IDENT "c"
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- doc_examples"
  WHITESPACE "\n"
  CREATE_INDEX
    CREATE_KW "CREATE"
    WHITESPACE " "
    UNIQUE_KW "UNIQUE"
    WHITESPACE " "
    INDEX_KW "INDEX"
    WHITESPACE " "
    NAME
      IDENT "title_idx"
    WHITESPACE " "
    ON_KW "ON"
    WHITESPACE " "
    RELATION_NAME
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "films"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      PARTITION_ITEM
        NAME_REF
          IDENT "title"
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  CREATE_INDEX
    CREATE_KW "CREATE"
    WHITESPACE " "
    UNIQUE_KW "UNIQUE"
    WHITESPACE " "
    INDEX_KW "INDEX"
    WHITESPACE " "
    NAME
      IDENT "title_idx"
    WHITESPACE " "
    ON_KW "ON"
    WHITESPACE " "
    RELATION_NAME
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "films"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      PARTITION_ITEM
        NAME_REF
          IDENT "title"
      R_PAREN ")"
    WHITESPACE " "
    CONSTRAINT_INCLUDE_CLAUSE
      INCLUDE_KW "INCLUDE"
      WHITESPACE " "
      COLUMN_LIST
        L_PAREN "("
        COLUMN
          NAME_REF
            IDENT "director"
        COMMA ","
        WHITESPACE " "
        COLUMN
          NAME_REF
            IDENT "rating"
        R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  CREATE_INDEX
    CREATE_KW "CREATE"
    WHITESPACE " "
    INDEX_KW "INDEX"
    WHITESPACE " "
    NAME
      IDENT "title_idx"
    WHITESPACE " "
    ON_KW "ON"
    WHITESPACE " "
    RELATION_NAME
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "films"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      PARTITION_ITEM
        NAME_REF
          IDENT "title"
      R_PAREN ")"
    WHITESPACE " "
    WITH_PARAMS
      WITH_KW "WITH"
      WHITESPACE " "
      ATTRIBUTE_LIST
        L_PAREN "("
        ATTRIBUTE_OPTION
          NAME
            IDENT "deduplicate_items"
          WHITESPACE " "
          EQ "="
          WHITESPACE " "
          ATTRIBUTE_VALUE
            LITERAL
              OFF_KW "off"
        R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  CREATE_INDEX
    CREATE_KW "CREATE"
    WHITESPACE " "
    INDEX_KW "INDEX"
    WHITESPACE " "
    ON_KW "ON"
    WHITESPACE " "
    RELATION_NAME
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "films"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      PARTITION_ITEM
        PAREN_EXPR
          L_PAREN "("
          CALL_EXPR
            NAME_REF
              IDENT "lower"
            ARG_LIST
              L_PAREN "("
              NAME_REF
                IDENT "title"
              R_PAREN ")"
          R_PAREN ")"
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  CREATE_INDEX
    CREATE_KW "CREATE"
    WHITESPACE " "
    INDEX_KW "INDEX"
    WHITESPACE " "
    NAME
      IDENT "title_idx_german"
    WHITESPACE " "
    ON_KW "ON"
    WHITESPACE " "
    RELATION_NAME
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "films"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      PARTITION_ITEM
        BIN_EXPR
          NAME_REF
            IDENT "title"
          WHITESPACE " "
          COLLATE_KW "COLLATE"
          WHITESPACE " "
          NAME_REF
            IDENT "\"de_DE\""
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  CREATE_INDEX
    CREATE_KW "CREATE"
    WHITESPACE " "
    INDEX_KW "INDEX"
    WHITESPACE " "
    NAME
      IDENT "title_idx_nulls_low"
    WHITESPACE " "
    ON_KW "ON"
    WHITESPACE " "
    RELATION_NAME
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "films"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      PARTITION_ITEM
        NAME_REF
          IDENT "title"
        WHITESPACE " "
        NULLS_FIRST
          NULLS_KW "NULLS"
          WHITESPACE " "
          FIRST_KW "FIRST"
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  CREATE_INDEX
    CREATE_KW "CREATE"
    WHITESPACE " "
    UNIQUE_KW "UNIQUE"
    WHITESPACE " "
    INDEX_KW "INDEX"
    WHITESPACE " "
    NAME
      IDENT "title_idx"
    WHITESPACE " "
    ON_KW "ON"
    WHITESPACE " "
    RELATION_NAME
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "films"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      PARTITION_ITEM
        NAME_REF
          IDENT "title"
      R_PAREN ")"
    WHITESPACE " "
    WITH_PARAMS
      WITH_KW "WITH"
      WHITESPACE " "
      ATTRIBUTE_LIST
        L_PAREN "("
        ATTRIBUTE_OPTION
          NAME
            IDENT "fillfactor"
          WHITESPACE " "
          EQ "="
          WHITESPACE " "
          ATTRIBUTE_VALUE
            LITERAL
              INT_NUMBER "70"
        R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  CREATE_INDEX
    CREATE_KW "CREATE"
    WHITESPACE " "
    INDEX_KW "INDEX"
    WHITESPACE " "
    NAME
      IDENT "gin_idx"
    WHITESPACE " "
    ON_KW "ON"
    WHITESPACE " "
    RELATION_NAME
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "documents_table"
    WHITESPACE " "
    USING_METHOD
      USING_KW "USING"
      WHITESPACE " "
      NAME_REF
        IDENT "GIN"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      PARTITION_ITEM
        NAME_REF
          IDENT "locations"
      R_PAREN ")"
    WHITESPACE " "
    WITH_PARAMS
      WITH_KW "WITH"
      WHITESPACE " "
      ATTRIBUTE_LIST
        L_PAREN "("
        ATTRIBUTE_OPTION
          NAME
            IDENT "fastupdate"
          WHITESPACE " "
          EQ "="
          WHITESPACE " "
          ATTRIBUTE_VALUE
            LITERAL
              OFF_KW "off"
        R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  CREATE_INDEX
    CREATE_KW "CREATE"
    WHITESPACE " "
    INDEX_KW "INDEX"
    WHITESPACE " "
    NAME
      IDENT "code_idx"
    WHITESPACE " "
    ON_KW "ON"
    WHITESPACE " "
    RELATION_NAME
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "films"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      PARTITION_ITEM
        NAME_REF
          IDENT "code"
      R_PAREN ")"
    WHITESPACE " "
    TABLESPACE
      TABLESPACE_KW "TABLESPACE"
      WHITESPACE " "
      NAME_REF
        IDENT "indexspace"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  CREATE_INDEX
    CREATE_KW "CREATE"
    WHITESPACE " "
    INDEX_KW "INDEX"
    WHITESPACE " "
    NAME
      IDENT "pointloc"
    WHITESPACE "\n    "
    ON_KW "ON"
    WHITESPACE " "
    RELATION_NAME
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "points"
    WHITESPACE " "
    USING_METHOD
      USING_KW "USING"
      WHITESPACE " "
      NAME_REF
        IDENT "gist"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      PARTITION_ITEM
        CALL_EXPR
          NAME_REF
            IDENT "box"
          ARG_LIST
            L_PAREN "("
            NAME_REF
              LOCATION_KW "location"
            COMMA ","
            NAME_REF
              LOCATION_KW "location"
            R_PAREN ")"
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  CREATE_INDEX
    CREATE_KW "CREATE"
    WHITESPACE " "
    INDEX_KW "INDEX"
    WHITESPACE " "
    CONCURRENTLY_KW "CONCURRENTLY"
    WHITESPACE " "
    NAME
      IDENT "sales_quantity_index"
    WHITESPACE " "
    ON_KW "ON"
    WHITESPACE " "
    RELATION_NAME
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "sales_table"
    WHITESPACE " "
    PARTITION_ITEM_LIST
      L_PAREN "("
      PARTITION_ITEM
        NAME_REF
          IDENT "quantity"
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
