Skip to content

开关字段 ​

开关字段用于存储布尔值,表示是/否两种状态。

物理字段类型 ​

  • MySQL: tinyint(1)
  • PostgreSQL: tinyint(1)
  • SQLite: integer

适用场景 ​

  • 启用状态
  • 是否可见
  • 是否默认
  • 是否已读
  • 是否推荐

API 返回示例 ​

json
{
  "is_active": true,
  "is_visible": false,
  "is_default": true
}

Released under the MIT License.