---
source: crates/squawk_parser/tests/tests.rs
input_file: crates/squawk_parser/tests/data/ok/create_table_as.sql
---
SOURCE_FILE
  COMMENT "-- execute"
  WHITESPACE "\n"
  CREATE_TABLE_AS
    CREATE_KW "create"
    WHITESPACE " "
    TEMP
      TEMP_KW "temp"
    WHITESPACE " "
    TABLE_KW "table"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME
          IDENT "t"
    WHITESPACE " "
    ON_COMMIT
      ON_KW "on"
      WHITESPACE " "
      COMMIT_KW "commit"
      WHITESPACE " "
      DROP
        DROP_KW "drop"
    WHITESPACE " "
    AS_KW "as"
    WHITESPACE "\n  "
    EXECUTE
      EXECUTE_KW "execute"
      WHITESPACE " "
      NAME_REF
        IDENT "f"
      ARG_LIST
        L_PAREN "("
        NAME_REF
          IDENT "a"
        R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- select"
  WHITESPACE "\n"
  CREATE_TABLE_AS
    CREATE_KW "create"
    WHITESPACE " "
    TABLE_KW "table"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME
          IDENT "t"
    WHITESPACE " "
    AS_KW "as"
    WHITESPACE "\n  "
    SELECT
      SELECT_CLAUSE
        SELECT_KW "select"
        WHITESPACE " "
        TARGET_LIST
          TARGET
            STAR "*"
      WHITESPACE " "
      FROM_CLAUSE
        FROM_KW "from"
        WHITESPACE " "
        FROM_ITEM
          NAME_REF
            IDENT "u"
      WHITESPACE " "
      WHERE_CLAUSE
        WHERE_KW "where"
        WHITESPACE " "
        BIN_EXPR
          NAME_REF
            IDENT "c"
          WHITESPACE " "
          GTEQ ">="
          WHITESPACE " "
          NAME_REF
            IDENT "b"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- table"
  WHITESPACE "\n"
  CREATE_TABLE_AS
    CREATE_KW "create"
    WHITESPACE " "
    TABLE_KW "table"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME
          IDENT "t"
    WHITESPACE " "
    AS_KW "as"
    WHITESPACE "\n  "
    TABLE
      TABLE_KW "table"
      WHITESPACE " "
      RELATION_NAME
        PATH
          PATH_SEGMENT
            NAME_REF
              IDENT "u"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- more fields"
  WHITESPACE "\n"
  CREATE_TABLE_AS
    CREATE_KW "create"
    WHITESPACE " "
    TEMP
      LOCAL_KW "local"
      WHITESPACE " "
      TEMPORARY_KW "temporary"
    WHITESPACE " "
    TABLE_KW "table"
    WHITESPACE " \n  "
    PATH
      PATH_SEGMENT
        NAME
          IDENT "t"
    WHITESPACE " "
    TABLE_ARG_LIST
      L_PAREN "("
      COLUMN
        NAME
          IDENT "a"
      COMMA ","
      WHITESPACE " "
      COLUMN
        NAME
          IDENT "b"
      COMMA ","
      WHITESPACE " "
      COLUMN
        NAME
          IDENT "c"
      R_PAREN ")"
    WHITESPACE "\n  "
    USING_METHOD
      USING_KW "using"
      WHITESPACE " "
      NAME_REF
        IDENT "foo"
    WHITESPACE "\n  "
    WITH_PARAMS
      WITH_KW "with"
      WHITESPACE " "
      ATTRIBUTE_LIST
        L_PAREN "("
        ATTRIBUTE_OPTION
          NAME
            IDENT "x"
          WHITESPACE " "
          EQ "="
          WHITESPACE " "
          ATTRIBUTE_VALUE
            LITERAL
              INT_NUMBER "1"
        COMMA ","
        WHITESPACE " "
        ATTRIBUTE_OPTION
          NAME
            IDENT "b"
        R_PAREN ")"
    WHITESPACE "\n  "
    ON_COMMIT
      ON_KW "on"
      WHITESPACE " "
      COMMIT_KW "commit"
      WHITESPACE " "
      DELETE_ROWS
        DELETE_KW "delete"
        WHITESPACE " "
        ROWS_KW "rows"
    WHITESPACE "\n  "
    TABLESPACE
      TABLESPACE_KW "tablespace"
      WHITESPACE " "
      NAME_REF
        IDENT "bar"
    WHITESPACE "\n  "
    AS_KW "as"
    WHITESPACE " "
    SELECT
      SELECT_CLAUSE
        SELECT_KW "select"
        WHITESPACE " "
        TARGET_LIST
          TARGET
            LITERAL
              INT_NUMBER "1"
    WHITESPACE "\n  "
    WITH_DATA
      WITH_KW "with"
      WHITESPACE " "
      DATA_KW "data"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  CREATE_TABLE_AS
    CREATE_KW "create"
    WHITESPACE " "
    TEMP
      GLOBAL_KW "global"
      WHITESPACE " "
      TEMP_KW "temp"
    WHITESPACE " "
    TABLE_KW "table"
    WHITESPACE " \n  "
    IF_NOT_EXISTS
      IF_KW "if"
      WHITESPACE " "
      NOT_KW "not"
      WHITESPACE " "
      EXISTS_KW "exists"
    WHITESPACE " \n  "
    PATH
      PATH_SEGMENT
        NAME
          IDENT "u"
    WHITESPACE " "
    TABLE_ARG_LIST
      L_PAREN "("
      COLUMN
        NAME
          IDENT "a"
      R_PAREN ")"
    WHITESPACE "\n  "
    USING_METHOD
      USING_KW "using"
      WHITESPACE " "
      NAME_REF
        IDENT "foo"
    WHITESPACE "\n  "
    WITHOUT_OIDS
      WITHOUT_KW "without"
      WHITESPACE " "
      OIDS_KW "oids"
    WHITESPACE "\n  "
    ON_COMMIT
      ON_KW "on"
      WHITESPACE " "
      COMMIT_KW "commit"
      WHITESPACE " "
      PRESERVE_ROWS
        PRESERVE_KW "preserve"
        WHITESPACE " "
        ROWS_KW "rows"
    WHITESPACE "\n  "
    TABLESPACE
      TABLESPACE_KW "tablespace"
      WHITESPACE " "
      NAME_REF
        IDENT "foo"
    WHITESPACE "\n  "
    AS_KW "as"
    WHITESPACE " "
    SELECT
      SELECT_CLAUSE
        SELECT_KW "select"
        WHITESPACE " "
        TARGET_LIST
          TARGET
            LITERAL
              INT_NUMBER "2"
    WHITESPACE "\n  "
    WITH_NO_DATA
      WITH_KW "with"
      WHITESPACE " "
      NO_KW "no"
      WHITESPACE " "
      DATA_KW "data"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- unlogged"
  WHITESPACE "\n"
  CREATE_TABLE_AS
    CREATE_KW "create"
    WHITESPACE " "
    UNLOGGED
      UNLOGGED_KW "unlogged"
    WHITESPACE " "
    TABLE_KW "table"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME
          IDENT "u"
    WHITESPACE "\n  "
    AS_KW "as"
    WHITESPACE " "
    SELECT
      SELECT_CLAUSE
        SELECT_KW "select"
        WHITESPACE " "
        TARGET_LIST
          TARGET
            LITERAL
              INT_NUMBER "2"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  COMMENT "-- values"
  WHITESPACE "\n"
  CREATE_TABLE_AS
    CREATE_KW "create"
    WHITESPACE " "
    TEMP
      TEMPORARY_KW "temporary"
    WHITESPACE " "
    TABLE_KW "table"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME
          IDENT "t"
    WHITESPACE " "
    AS_KW "as"
    WHITESPACE "\n  "
    VALUES
      VALUES_KW "values"
      WHITESPACE " "
      ROW_LIST
        ROW
          L_PAREN "("
          LITERAL
            INT_NUMBER "1"
          R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
  CREATE_TABLE_AS
    CREATE_KW "create"
    WHITESPACE " "
    TEMP
      TEMPORARY_KW "temporary"
    WHITESPACE " "
    TABLE_KW "table"
    WHITESPACE " "
    PATH
      PATH_SEGMENT
        NAME
          IDENT "t"
    WHITESPACE " "
    AS_KW "as"
    WHITESPACE "\n  "
    VALUES
      VALUES_KW "values"
      WHITESPACE " "
      ROW_LIST
        ROW
          L_PAREN "("
          LITERAL
            INT_NUMBER "1"
          COMMA ","
          WHITESPACE " "
          LITERAL
            INT_NUMBER "3"
          R_PAREN ")"
        COMMA ","
        WHITESPACE " "
        ROW
          L_PAREN "("
          NAME_REF
            IDENT "a"
          COMMA ","
          WHITESPACE " "
          LITERAL
            INT_NUMBER "5"
          R_PAREN ")"
  SEMICOLON ";"
  WHITESPACE "\n\n"
