12345678910111213141516171819202122232425262728293031323334353637 |
- package db
- import (
- "github.com/gshopify/service-wrapper/model"
- "gshopper.com/gshopify/products/cache"
- "time"
- )
- var (
- productKey = func(clause string, args ...any) *cache.SqlKey {
- return cache.NewSQLKey(
- "product",
- time.Minute,
- clause,
- args...,
- )
- }
- productSelection = func(ln model.LanguageCode) []string {
- return append([]string{
- "id", "profile_id", "collection_ids", "type_id", "handle", "thumbnail", "is_giftcard", "discountable",
- "hs_code", "mid_code", "weight", "length", "height", "width", "origin_country", "vendor", "material",
- "created_at", "updated_at", "deleted_at", "tags", "status",
- },
- ln.SqlFieldSelection("title"),
- ln.SqlFieldSelection("subtitle"),
- ln.SqlFieldSelection("description"),
- )
- }
- productCollectionKey = func(clause string, args ...any) *cache.SqlKey {
- return cache.NewSQLKey(
- "product_collection",
- 3*time.Minute,
- clause,
- args...,
- )
- }
- )
|