大小写敏感
请注意,大小写敏感性取决于数据库和数据库排序规则。
MySQL 默认情况下使用不区分大小写,而 postgres 区分大小写。
建议查看 关于大小写敏感性的完整文档 (在新标签页中打开).
显式查询大小写(不)敏感数据
这仅针对 Postgres 生成。
users, err := client.User.FindMany(
User.Email.Equals("prisMa"),
User.Email.Mode(QueryModeInsensitive), // sets case insensitivity
).Exec(ctx)
+----+-----------------------------------+
| id | email |
+----+-----------------------------------+
| 61 | [email protected] |
| 49 | [email protected] |
+----+-----------------------------------+