Generate caches that support custom key prefix. (#4643)

This commit is contained in:
kesonan
2025-02-12 23:31:30 +08:00
committed by GitHub
parent 48d0709ca6
commit 7a4818da59
9 changed files with 60 additions and 45 deletions

View File

@@ -34,7 +34,7 @@ func TestGenCacheKeys(t *testing.T) {
Comment: "姓名",
SeqInIndex: 2,
}
primariCacheKey, uniqueCacheKey := genCacheKeys(parser.Table{
primariCacheKey, uniqueCacheKey := genCacheKeys("cache", parser.Table{
Name: stringx.From("user"),
Db: stringx.From("go_zero"),
PrimaryKey: parser.Primary{
@@ -129,7 +129,7 @@ func TestGenCacheKeys(t *testing.T) {
}())
})
t.Run("no database name", func(t *testing.T) {
primariCacheKey, _ = genCacheKeys(parser.Table{
primariCacheKey, _ = genCacheKeys("cache", parser.Table{
Name: stringx.From("user"),
Db: stringx.From(""),
PrimaryKey: parser.Primary{