11package schema
22
33import (
4- "context"
5- "encoding/json"
64 "time"
75
86 "github.com/rs/zerolog"
@@ -20,24 +18,24 @@ type Meta struct {
2018const FetchIdMetaKey = "cq_fetch_id"
2119
2220var (
23- cqMeta = Column {
24- Name : "cq_meta" ,
25- Type : TypeJSON ,
26- Description : "Meta column holds fetch information" ,
27- Resolver : func (ctx context.Context , meta ClientMeta , resource * Resource , c Column ) error {
28- mi := Meta {
29- LastUpdate : time .Now ().UTC (),
30- }
31- if val , ok := resource .GetMeta (FetchIdMetaKey ); ok {
32- if s , ok := val .(string ); ok {
33- mi .FetchId = s
34- }
35- }
36- b , _ := json .Marshal (mi )
37- return resource .Set (c .Name , b )
38- },
39- internal : true ,
40- }
21+ // cqMeta = Column{
22+ // Name: "cq_meta",
23+ // Type: TypeJSON,
24+ // Description: "Meta column holds fetch information",
25+ // Resolver: func(ctx context.Context, meta ClientMeta, resource *Resource, c Column) error {
26+ // mi := Meta{
27+ // LastUpdate: time.Now().UTC(),
28+ // }
29+ // if val, ok := resource.GetMeta(FetchIdMetaKey); ok {
30+ // if s, ok := val.(string); ok {
31+ // mi.FetchId = s
32+ // }
33+ // }
34+ // b, _ := json.Marshal(mi)
35+ // return resource.Set(c.Name, b)
36+ // },
37+ // internal: true,
38+ // }
4139 cqIdColumn = Column {
4240 Name : "cq_id" ,
4341 Type : TypeUUID ,
@@ -58,23 +56,23 @@ var (
5856 },
5957 internal : true ,
6058 }
61- cqFetchDateColumn = Column {
62- Name : "cq_fetch_date" ,
63- Type : TypeTimestamp ,
64- Description : "Time of fetch for this resource" ,
65- // Resolver: func(ctx context.Context, meta ClientMeta, resource *Resource, c Column) error {
66- // val, ok := resource.GetMeta("cq_fetch_date")
67- // if !ok && !resource.executionStart.IsZero() {
68- // val = resource.executionStart
69- // }
70- // if val == nil {
71- // return fmt.Errorf("zero cq_fetch date")
72- // }
73- // return resource.Set(c.Name, val)
74- // },
75- CreationOptions : ColumnCreationOptions {
76- NotNull : true ,
77- },
78- internal : true ,
79- }
59+ // cqFetchDateColumn = Column{
60+ // Name: "cq_fetch_date",
61+ // Type: TypeTimestamp,
62+ // Description: "Time of fetch for this resource",
63+ // // Resolver: func(ctx context.Context, meta ClientMeta, resource *Resource, c Column) error {
64+ // // val, ok := resource.GetMeta("cq_fetch_date")
65+ // // if !ok && !resource.executionStart.IsZero() {
66+ // // val = resource.executionStart
67+ // // }
68+ // // if val == nil {
69+ // // return fmt.Errorf("zero cq_fetch date")
70+ // // }
71+ // // return resource.Set(c.Name, val)
72+ // // },
73+ // CreationOptions: ColumnCreationOptions{
74+ // NotNull: true,
75+ // },
76+ // internal: true,
77+ // }
8078)
0 commit comments