Best way to store enum values in database - String or Int

前端 未结 2 1591
忘了有多久
忘了有多久 2021-02-12 11:13

I have a number of enums in my application which are used as property type in some classes.

What is the best way to store these values in database, as String or Int?

2条回答
  •  半阙折子戏
    2021-02-12 12:02

    The implementation is easy in both cases, and performance differences should be minor.

    Therefore, go for the meaning : the Strings are more meaningful than numbers, so use the String.

提交回复
热议问题