add multi unique support

添加多个unique index支持,调整unique接口名。
FetchUniqueBy[xxx]
This commit is contained in:
谢小军
2020-06-16 17:51:58 +08:00
parent 2b63b9f7ce
commit 19b39a0b41
4 changed files with 10 additions and 6 deletions

View File

@@ -195,7 +195,7 @@ func widthFunctionName(info FList) string {
case ColumnsKeyPrimary: // primary key.主键
return "FetchByPrimaryKey"
case ColumnsKeyUnique: // unique key.唯一索引
return "FetchByUnique"
return "FetchUniqueBy" + getCamelName(info.KeyName)
case ColumnsKeyIndex: // index key.复合索引
return "FetchIndexBy" + getCamelName(info.KeyName)
case ColumnsKeyUniqueIndex: // unique index key.唯一复合索引
@@ -204,3 +204,7 @@ func widthFunctionName(info FList) string {
return ""
}
func fixNotes(str string) string { // 注释
return strings.Replace(str, "\n", "\n//", -1)
}