---
source: crates/squawk_parser/tests/tests.rs
input_file: crates/squawk_parser/tests/data/ok/create_type.sql
---
SOURCE_FILE
  COMMENT "-- create_type_as"
  WHITESPACE "\n"
  CREATE_TYPE
    CREATE_KW "create"
    WHITESPACE " "
    TYPE_KW "type"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME
          IDENT "t"
    WHITESPACE " "
    AS_KW "as"
    WHITESPACE " "
    COLUMN_LIST
      L_PAREN "("
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  CREATE_TYPE
    CREATE_KW "create"
    WHITESPACE " "
    TYPE_KW "type"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME
          IDENT "t"
    WHITESPACE " "
    AS_KW "as"
    WHITESPACE " "
    COLUMN_LIST
      L_PAREN "("
      WHITESPACE "\n  "
      COLUMN
        NAME
          IDENT "a"
        WHITESPACE " "
        PATH_TYPE
          PATH
            PATH_SEGMENT
              NAME_REF
                IDENT "int8"
        WHITESPACE " "
        COLLATE
          COLLATE_KW "collate"
          WHITESPACE " "
          PATH
            PATH_SEGMENT
              NAME_REF
                IDENT "\"fr_FR\""
      WHITESPACE "\n"
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  CREATE_TYPE
    CREATE_KW "create"
    WHITESPACE " "
    TYPE_KW "type"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME
          IDENT "t"
    WHITESPACE " "
    AS_KW "as"
    WHITESPACE " "
    COLUMN_LIST
      L_PAREN "("
      WHITESPACE "\n  "
      COLUMN
        NAME
          IDENT "a"
        WHITESPACE " "
        PATH_TYPE
          PATH
            PATH_SEGMENT
              NAME_REF
                IDENT "int8"
        WHITESPACE " "
        COLLATE
          COLLATE_KW "collate"
          WHITESPACE " "
          PATH
            PATH_SEGMENT
              NAME_REF
                IDENT "\"fr_FR\""
      COMMA ","
      WHITESPACE "\n  "
      COLUMN
        NAME
          IDENT "b"
        WHITESPACE " "
        PATH_TYPE
          PATH
            PATH_SEGMENT
              NAME_REF
                INT_KW "int"
      COMMA ","
      WHITESPACE "\n  "
      COLUMN
        NAME
          IDENT "c"
        WHITESPACE " "
        PATH_TYPE
          PATH
            PATH_SEGMENT
              NAME_REF
                TEXT_KW "text"
      WHITESPACE "\n"
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- create_type_as_enum"
  WHITESPACE "\n"
  CREATE_TYPE
    CREATE_KW "create"
    WHITESPACE " "
    TYPE_KW "type"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME
          IDENT "t"
    WHITESPACE " "
    AS_KW "as"
    WHITESPACE " "
    ENUM_KW "enum"
    WHITESPACE " "
    VARIANT_LIST
      L_PAREN "("
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n"
  CREATE_TYPE
    CREATE_KW "create"
    WHITESPACE " "
    TYPE_KW "type"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME
          IDENT "t"
    WHITESPACE " "
    AS_KW "as"
    WHITESPACE " "
    ENUM_KW "enum"
    WHITESPACE " "
    VARIANT_LIST
      L_PAREN "("
      VARIANT
        LITERAL
          STRING "'a'"
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n"
  CREATE_TYPE
    CREATE_KW "create"
    WHITESPACE " "
    TYPE_KW "type"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME
          IDENT "t"
    WHITESPACE " "
    AS_KW "as"
    WHITESPACE " "
    ENUM_KW "enum"
    WHITESPACE " "
    VARIANT_LIST
      L_PAREN "("
      VARIANT
        LITERAL
          STRING "'a'"
      COMMA ","
      WHITESPACE " "
      VARIANT
        LITERAL
          STRING "'b'"
      COMMA ","
      WHITESPACE " "
      VARIANT
        LITERAL
          STRING "'c'"
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- create_type_as_range"
  WHITESPACE "\n"
  CREATE_TYPE
    CREATE_KW "create"
    WHITESPACE " "
    TYPE_KW "type"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME
          IDENT "t"
    WHITESPACE " "
    AS_KW "as"
    WHITESPACE " "
    RANGE_KW "range"
    WHITESPACE " "
    ATTRIBUTE_LIST
      L_PAREN "("
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          IDENT "subtype"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  BIGINT_KW "bigint"
      WHITESPACE "\n"
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n\n\n"
  COMMENT "-- schema"
  WHITESPACE "\n"
  CREATE_TYPE
    CREATE_KW "create"
    WHITESPACE " "
    TYPE_KW "type"
    WHITESPACE " "
    PATH
      PATH
        PATH_SEGMENT
          NAME_REF
            IDENT "public"
      DOT "."
      PATH_SEGMENT
        NAME
          IDENT "t"
  SEMICOLON ";"
  WHITESPACE "\n"
  CREATE_TYPE
    CREATE_KW "create"
    WHITESPACE " "
    TYPE_KW "type"
    WHITESPACE " "
    PATH
      PATH
        PATH
          PATH
            PATH_SEGMENT
              NAME_REF
                IDENT "a"
          DOT "."
          PATH_SEGMENT
            NAME_REF
              IDENT "b"
        DOT "."
        PATH_SEGMENT
          NAME_REF
            IDENT "c"
      DOT "."
      PATH_SEGMENT
        NAME
          IDENT "d"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- create_type_name"
  WHITESPACE "\n"
  CREATE_TYPE
    CREATE_KW "create"
    WHITESPACE " "
    TYPE_KW "type"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME
          IDENT "t"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  CREATE_TYPE
    CREATE_KW "create"
    WHITESPACE " "
    TYPE_KW "type"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME
          IDENT "t"
    WHITESPACE " "
    ATTRIBUTE_LIST
      L_PAREN "("
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          INPUT_KW "input"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          PATH_TYPE
            PATH
              PATH
                PATH
                  PATH_SEGMENT
                    NAME_REF
                      IDENT "foo"
                DOT "."
                PATH_SEGMENT
                  NAME_REF
                    IDENT "bar"
              DOT "."
              PATH_SEGMENT
                NAME_REF
                  IDENT "func_name"
      COMMA ","
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          IDENT "output"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  IDENT "func_name"
      WHITESPACE "\n"
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  CREATE_TYPE
    CREATE_KW "create"
    WHITESPACE " "
    TYPE_KW "type"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME
          IDENT "t"
    WHITESPACE " "
    ATTRIBUTE_LIST
      L_PAREN "("
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          INPUT_KW "input"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          PATH_TYPE
            PATH
              PATH
                PATH
                  PATH_SEGMENT
                    NAME_REF
                      IDENT "foo"
                DOT "."
                PATH_SEGMENT
                  NAME_REF
                    IDENT "bar"
              DOT "."
              PATH_SEGMENT
                NAME_REF
                  IDENT "func_name"
      COMMA ","
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          IDENT "output"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  IDENT "func_name"
      COMMA ","
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          IDENT "receive"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  IDENT "receive_function"
      COMMA ","
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          IDENT "send"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  IDENT "send_function"
      COMMA ","
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          IDENT "typmod_in"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  IDENT "type_modifier_input_function"
      COMMA ","
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          IDENT "typmod_out"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  IDENT "type_modifier_output_function"
      COMMA ","
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          ANALYZE_KW "analyze"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  IDENT "analyze_function"
      COMMA ","
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          IDENT "subscript"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  IDENT "subscript_function"
      COMMA ","
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          IDENT "internallength"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  IDENT "variable"
      COMMA ","
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          IDENT "passedbyvalue"
      COMMA ","
      WHITESPACE "\n  "
      COMMENT "-- The allowed values equate to alignment on 1, 2, 4, or 8 byte boundaries."
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          IDENT "alignment"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          LITERAL
            INT_NUMBER "1"
      COMMA ","
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          STORAGE_KW "storage"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  IDENT "plain"
      COMMA ","
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          LIKE_KW "like"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  IDENT "like_type"
      COMMA ","
      WHITESPACE "\n  "
      COMMENT "-- see: https://www.postgresql.org/docs/17/catalog-pg-type.html#CATALOG-TYPCATEGORY-TABLE"
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          IDENT "category"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          LITERAL
            STRING "'U'"
      COMMA ","
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          IDENT "preferred"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          LITERAL
            FALSE_KW "false"
      COMMA ","
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          DEFAULT_KW "default"
        WHITESPACE " "
        EQ "="
        WHITESPACE "  "
        ATTRIBUTE_VALUE
          NULL_KW "null"
      COMMA ","
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          IDENT "element"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          PATH_TYPE
            PATH
              PATH_SEGMENT
                NAME_REF
                  IDENT "float4"
      COMMA ","
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          DELIMITER_KW "delimiter"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          LITERAL
            STRING "','"
      COMMA ","
      WHITESPACE "\n  "
      ATTRIBUTE_OPTION
        NAME
          IDENT "collatable"
        WHITESPACE " "
        EQ "="
        WHITESPACE " "
        ATTRIBUTE_VALUE
          LITERAL
            TRUE_KW "true"
      WHITESPACE "\n"
      R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n\n"
