Skip to content

Commit

Permalink
api: add SqlInfoKey
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-jukovec committed Apr 24, 2023
1 parent 349e853 commit e315914
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ package iproto
//go:generate stringer -type=Feature
//go:generate stringer -type=Flag
//go:generate stringer -type=Type
//go:generate stringer -type=Key,MetadataKey,BallotKey,RaftKey -output=keys_string.go
//go:generate stringer -type=Key,MetadataKey,BallotKey,RaftKey,SqlInfoKey -output=keys_string.go
//go:generate goimports -w .
13 changes: 13 additions & 0 deletions generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ cd ..

SRC_CONST=${TT_DIR}/src/box/iproto_constants.h
SRC_ERRORS=${TT_DIR}/src/box/errcode.h
SRC_EXECUTE=${TT_DIR}/src/box/execute.h
SRC_FEATURES=${TT_DIR}/src/box/iproto_features.h
DST_DOC=doc.go
DST_ERRORS=error.go
Expand Down Expand Up @@ -293,6 +294,15 @@ EOF
read_enum iproto_raft_keys ${SRC_CONST} | \
generate_enum RaftKey >> ${DST_KEYS}

cat << EOF >> ${DST_KEYS}
// IPROTO SQL info key constants, generated from
// ${SRC_EXECUTE}
EOF

read_enum sql_info_key ${SRC_EXECUTE} | \
generate_enum SqlInfoKey >> ${DST_KEYS}

echo "${FOOTER_TEST}" > ${DST_KEYS_TEST}

read_enum iproto_key ${SRC_CONST} | \
Expand All @@ -307,6 +317,9 @@ read_enum iproto_ballot_key ${SRC_CONST} | \
read_enum iproto_raft_keys ${SRC_CONST} | \
generate_test RaftKey >> ${DST_KEYS_TEST}

read_enum sql_info_key ${SRC_EXECUTE} | \
generate_test SqlInfoKey >> ${DST_KEYS_TEST}

#
# Cleanup.
#
Expand Down
9 changes: 9 additions & 0 deletions keys.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 19 additions & 1 deletion keys_string.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions keys_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e315914

Please sign in to comment.