|
@@ -278,14 +278,24 @@ func (c *Client) Replay(req *client.ReplayRequest) (string, error) {
|
|
|
}
|
|
|
|
|
|
func (c *Client) QueryByWhereAndOrderBy(req *client.QueryByWhereAndOrderByRequest) (string, []client.TableRow, int64, error) {
|
|
|
- selectJsonBytes, err := json.Marshal(req.Select)
|
|
|
- if err != nil {
|
|
|
- return "", nil, 0, err
|
|
|
+ var selectJsonBytes []byte
|
|
|
+ if req.Select != nil {
|
|
|
+ innerJsonBytes, err := req.Select.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, 0, err
|
|
|
+ }
|
|
|
+
|
|
|
+ selectJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
- whereJsonBytes, err := json.Marshal(req.Where)
|
|
|
- if err != nil {
|
|
|
- return "", nil, 0, err
|
|
|
+ var whereJsonBytes []byte
|
|
|
+ if req.Where != nil {
|
|
|
+ innerJsonBytes, err := req.Where.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, 0, err
|
|
|
+ }
|
|
|
+
|
|
|
+ whereJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
reply, err := c.queryServiceClient.QueryByWhereAndOrderBy(context.Background(), &request.QueryByWhereAndOrderByRequest{
|
|
@@ -311,29 +321,54 @@ func (c *Client) QueryByWhereAndOrderBy(req *client.QueryByWhereAndOrderByReques
|
|
|
}
|
|
|
|
|
|
func (c *Client) CommonQuery(req *client.CommonQueryRequest) (string, []client.TableRow, int64, error) {
|
|
|
- selectJsonBytes, err := json.Marshal(req.Select)
|
|
|
- if err != nil {
|
|
|
- return "", nil, 0, err
|
|
|
+ var selectJsonBytes []byte
|
|
|
+ if req.Select != nil {
|
|
|
+ innerJsonBytes, err := req.Select.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, 0, err
|
|
|
+ }
|
|
|
+
|
|
|
+ selectJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
- whereJsonBytes, err := json.Marshal(req.Where)
|
|
|
- if err != nil {
|
|
|
- return "", nil, 0, err
|
|
|
+ var whereJsonBytes []byte
|
|
|
+ if req.Where != nil {
|
|
|
+ innerJsonBytes, err := req.Where.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, 0, err
|
|
|
+ }
|
|
|
+
|
|
|
+ whereJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
- orJsonBytes, err := json.Marshal(req.Or)
|
|
|
- if err != nil {
|
|
|
- return "", nil, 0, err
|
|
|
+ var orJsonBytes []byte
|
|
|
+ if req.Or != nil {
|
|
|
+ innerJsonBytes, err := req.Or.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, 0, err
|
|
|
+ }
|
|
|
+
|
|
|
+ orJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
- joinsJsonBytes, err := json.Marshal(req.Joins)
|
|
|
- if err != nil {
|
|
|
- return "", nil, 0, err
|
|
|
+ var joinsJsonBytes []byte
|
|
|
+ if req.Joins != nil {
|
|
|
+ innerJsonBytes, err := req.Joins.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, 0, err
|
|
|
+ }
|
|
|
+
|
|
|
+ joinsJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
- havingJsonBytes, err := json.Marshal(req.Having)
|
|
|
- if err != nil {
|
|
|
- return "", nil, 0, err
|
|
|
+ var havingJsonBytes []byte
|
|
|
+ if req.Having != nil {
|
|
|
+ innerJsonBytes, err := req.Having.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, 0, err
|
|
|
+ }
|
|
|
+
|
|
|
+ havingJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
reply, err := c.queryServiceClient.CommonQuery(context.Background(), &request.CommonQueryRequest{
|
|
@@ -363,14 +398,24 @@ func (c *Client) CommonQuery(req *client.CommonQueryRequest) (string, []client.T
|
|
|
}
|
|
|
|
|
|
func (c *Client) QueryOnlyByWhereAndOrderBy(req *client.QueryByWhereAndOrderByRequest) (string, []client.TableRow, error) {
|
|
|
- selectJsonBytes, err := json.Marshal(req.Select)
|
|
|
- if err != nil {
|
|
|
- return "", nil, err
|
|
|
+ var selectJsonBytes []byte
|
|
|
+ if req.Select != nil {
|
|
|
+ innerJsonBytes, err := req.Select.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ selectJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
- whereJsonBytes, err := json.Marshal(req.Where)
|
|
|
- if err != nil {
|
|
|
- return "", nil, err
|
|
|
+ var whereJsonBytes []byte
|
|
|
+ if req.Where != nil {
|
|
|
+ innerJsonBytes, err := req.Where.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ whereJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
reply, err := c.queryServiceClient.QueryOnlyByWhereAndOrderBy(context.Background(), &request.QueryByWhereAndOrderByRequest{
|
|
@@ -396,29 +441,54 @@ func (c *Client) QueryOnlyByWhereAndOrderBy(req *client.QueryByWhereAndOrderByRe
|
|
|
}
|
|
|
|
|
|
func (c *Client) CommonQueryOnly(req *client.CommonQueryRequest) (string, []client.TableRow, error) {
|
|
|
- selectJsonBytes, err := json.Marshal(req.Select)
|
|
|
- if err != nil {
|
|
|
- return "", nil, err
|
|
|
+ var selectJsonBytes []byte
|
|
|
+ if req.Select != nil {
|
|
|
+ innerJsonBytes, err := req.Select.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ selectJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
- whereJsonBytes, err := json.Marshal(req.Where)
|
|
|
- if err != nil {
|
|
|
- return "", nil, err
|
|
|
+ var whereJsonBytes []byte
|
|
|
+ if req.Where != nil {
|
|
|
+ innerJsonBytes, err := req.Where.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ whereJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
- orJsonBytes, err := json.Marshal(req.Or)
|
|
|
- if err != nil {
|
|
|
- return "", nil, err
|
|
|
+ var orJsonBytes []byte
|
|
|
+ if req.Or != nil {
|
|
|
+ innerJsonBytes, err := req.Or.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ orJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
- joinsJsonBytes, err := json.Marshal(req.Joins)
|
|
|
- if err != nil {
|
|
|
- return "", nil, err
|
|
|
+ var joinsJsonBytes []byte
|
|
|
+ if req.Joins != nil {
|
|
|
+ innerJsonBytes, err := req.Joins.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ joinsJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
- havingJsonBytes, err := json.Marshal(req.Having)
|
|
|
- if err != nil {
|
|
|
- return "", nil, err
|
|
|
+ var havingJsonBytes []byte
|
|
|
+ if req.Having != nil {
|
|
|
+ innerJsonBytes, err := req.Having.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ havingJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
reply, err := c.queryServiceClient.CommonQueryOnly(context.Background(), &request.CommonQueryRequest{
|
|
@@ -448,9 +518,14 @@ func (c *Client) CommonQueryOnly(req *client.CommonQueryRequest) (string, []clie
|
|
|
}
|
|
|
|
|
|
func (c *Client) QueryByKeys(req *client.QueryByKeysRequest) (string, *client.TableRow, error) {
|
|
|
- selectJsonBytes, err := json.Marshal(req.Select)
|
|
|
- if err != nil {
|
|
|
- return "", nil, err
|
|
|
+ var selectJsonBytes []byte
|
|
|
+ if req.Select != nil {
|
|
|
+ innerJsonBytes, err := req.Select.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ selectJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
reply, err := c.queryServiceClient.QueryByKeys(context.Background(), &request.QueryByKeysRequest{
|
|
@@ -474,9 +549,14 @@ func (c *Client) QueryByKeys(req *client.QueryByKeysRequest) (string, *client.Ta
|
|
|
}
|
|
|
|
|
|
func (c *Client) CountWhere(req *client.CountWhereRequest) (string, int64, error) {
|
|
|
- whereJsonBytes, err := json.Marshal(req.Where)
|
|
|
- if err != nil {
|
|
|
- return "", 0, err
|
|
|
+ var whereJsonBytes []byte
|
|
|
+ if req.Where != nil {
|
|
|
+ innerJsonBytes, err := req.Where.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", 0, err
|
|
|
+ }
|
|
|
+
|
|
|
+ whereJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
reply, err := c.queryServiceClient.CountWhere(context.Background(), &request.CountWhereRequest{
|
|
@@ -493,24 +573,44 @@ func (c *Client) CountWhere(req *client.CountWhereRequest) (string, int64, error
|
|
|
}
|
|
|
|
|
|
func (c *Client) CommonCount(req *client.CommonCountRequest) (string, int64, error) {
|
|
|
- whereJsonBytes, err := json.Marshal(req.Where)
|
|
|
- if err != nil {
|
|
|
- return "", 0, err
|
|
|
+ var whereJsonBytes []byte
|
|
|
+ if req.Where != nil {
|
|
|
+ innerJsonBytes, err := req.Where.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", 0, err
|
|
|
+ }
|
|
|
+
|
|
|
+ whereJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
- orJsonBytes, err := json.Marshal(req.Or)
|
|
|
- if err != nil {
|
|
|
- return "", 0, err
|
|
|
+ var orJsonBytes []byte
|
|
|
+ if req.Or != nil {
|
|
|
+ innerJsonBytes, err := req.Or.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", 0, err
|
|
|
+ }
|
|
|
+
|
|
|
+ orJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
- joinsJsonBytes, err := json.Marshal(req.Joins)
|
|
|
- if err != nil {
|
|
|
- return "", 0, err
|
|
|
+ var joinsJsonBytes []byte
|
|
|
+ if req.Joins != nil {
|
|
|
+ innerJsonBytes, err := req.Joins.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", 0, err
|
|
|
+ }
|
|
|
+
|
|
|
+ joinsJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
- havingJsonBytes, err := json.Marshal(req.Having)
|
|
|
- if err != nil {
|
|
|
- return "", 0, err
|
|
|
+ var havingJsonBytes []byte
|
|
|
+ if req.Having != nil {
|
|
|
+ innerJsonBytes, err := req.Having.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", 0, err
|
|
|
+ }
|
|
|
+
|
|
|
+ havingJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
reply, err := c.queryServiceClient.CommonCount(context.Background(), &request.CommonCountRequest{
|
|
@@ -531,9 +631,14 @@ func (c *Client) CommonCount(req *client.CommonCountRequest) (string, int64, err
|
|
|
}
|
|
|
|
|
|
func (c *Client) EventQueryByKeys(req *client.EventQueryByKeysRequest) (string, []client.EventInfo, int64, error) {
|
|
|
- selectJsonBytes, err := json.Marshal(req.Select)
|
|
|
- if err != nil {
|
|
|
- return "", nil, 0, err
|
|
|
+ var selectJsonBytes []byte
|
|
|
+ if req.Select != nil {
|
|
|
+ innerJsonBytes, err := req.Select.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, 0, err
|
|
|
+ }
|
|
|
+
|
|
|
+ selectJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
reply, err := c.eventQueryServiceClient.EventQueryByKeys(context.Background(), &request.EventQueryByKeysRequest{
|
|
@@ -552,9 +657,14 @@ func (c *Client) EventQueryByKeys(req *client.EventQueryByKeysRequest) (string,
|
|
|
}
|
|
|
|
|
|
func (c *Client) CommonEventQuery(req *client.CommonEventQueryRequest) (string, []client.EventInfo, int64, error) {
|
|
|
- selectJsonBytes, err := json.Marshal(req.Select)
|
|
|
- if err != nil {
|
|
|
- return "", nil, 0, err
|
|
|
+ var selectJsonBytes []byte
|
|
|
+ if req.Select != nil {
|
|
|
+ innerJsonBytes, err := req.Select.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, 0, err
|
|
|
+ }
|
|
|
+
|
|
|
+ selectJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
reply, err := c.eventQueryServiceClient.CommonEventQuery(context.Background(), &request.CommonEventQueryRequest{
|
|
@@ -578,9 +688,14 @@ func (c *Client) CommonEventQuery(req *client.CommonEventQueryRequest) (string,
|
|
|
}
|
|
|
|
|
|
func (c *Client) EventQueryOnlyByKeys(req *client.EventQueryByKeysRequest) (string, []client.EventInfo, error) {
|
|
|
- selectJsonBytes, err := json.Marshal(req.Select)
|
|
|
- if err != nil {
|
|
|
- return "", nil, err
|
|
|
+ var selectJsonBytes []byte
|
|
|
+ if req.Select != nil {
|
|
|
+ innerJsonBytes, err := req.Select.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ selectJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
reply, err := c.eventQueryServiceClient.EventQueryOnlyByKeys(context.Background(), &request.EventQueryByKeysRequest{
|
|
@@ -599,9 +714,14 @@ func (c *Client) EventQueryOnlyByKeys(req *client.EventQueryByKeysRequest) (stri
|
|
|
}
|
|
|
|
|
|
func (c *Client) CommonEventQueryOnly(req *client.CommonEventQueryRequest) (string, []client.EventInfo, error) {
|
|
|
- selectJsonBytes, err := json.Marshal(req.Select)
|
|
|
- if err != nil {
|
|
|
- return "", nil, err
|
|
|
+ var selectJsonBytes []byte
|
|
|
+ if req.Select != nil {
|
|
|
+ innerJsonBytes, err := req.Select.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ selectJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
reply, err := c.eventQueryServiceClient.CommonEventQueryOnly(context.Background(), &request.CommonEventQueryRequest{
|
|
@@ -656,9 +776,14 @@ func (c *Client) CommonCountEvent(req *client.CommonCountEventRequest) (string,
|
|
|
}
|
|
|
|
|
|
func (c *Client) EventHistoryQueryByKeys(req *client.EventQueryByKeysRequest) (string, []client.EventInfo, int64, error) {
|
|
|
- selectJsonBytes, err := json.Marshal(req.Select)
|
|
|
- if err != nil {
|
|
|
- return "", nil, 0, err
|
|
|
+ var selectJsonBytes []byte
|
|
|
+ if req.Select != nil {
|
|
|
+ innerJsonBytes, err := req.Select.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, 0, err
|
|
|
+ }
|
|
|
+
|
|
|
+ selectJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
reply, err := c.eventQueryServiceClient.EventHistoryQueryByKeys(context.Background(), &request.EventQueryByKeysRequest{
|
|
@@ -677,9 +802,14 @@ func (c *Client) EventHistoryQueryByKeys(req *client.EventQueryByKeysRequest) (s
|
|
|
}
|
|
|
|
|
|
func (c *Client) CommonEventHistoryQuery(req *client.CommonEventQueryRequest) (string, []client.EventInfo, int64, error) {
|
|
|
- selectJsonBytes, err := json.Marshal(req.Select)
|
|
|
- if err != nil {
|
|
|
- return "", nil, 0, err
|
|
|
+ var selectJsonBytes []byte
|
|
|
+ if req.Select != nil {
|
|
|
+ innerJsonBytes, err := req.Select.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, 0, err
|
|
|
+ }
|
|
|
+
|
|
|
+ selectJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
reply, err := c.eventQueryServiceClient.CommonEventHistoryQuery(context.Background(), &request.CommonEventQueryRequest{
|
|
@@ -703,9 +833,14 @@ func (c *Client) CommonEventHistoryQuery(req *client.CommonEventQueryRequest) (s
|
|
|
}
|
|
|
|
|
|
func (c *Client) EventHistoryQueryOnlyByKeys(req *client.EventQueryByKeysRequest) (string, []client.EventInfo, error) {
|
|
|
- selectJsonBytes, err := json.Marshal(req.Select)
|
|
|
- if err != nil {
|
|
|
- return "", nil, err
|
|
|
+ var selectJsonBytes []byte
|
|
|
+ if req.Select != nil {
|
|
|
+ innerJsonBytes, err := req.Select.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ selectJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
reply, err := c.eventQueryServiceClient.EventHistoryQueryOnlyByKeys(context.Background(), &request.EventQueryByKeysRequest{
|
|
@@ -724,9 +859,14 @@ func (c *Client) EventHistoryQueryOnlyByKeys(req *client.EventQueryByKeysRequest
|
|
|
}
|
|
|
|
|
|
func (c *Client) CommonEventHistoryQueryOnly(req *client.CommonEventQueryRequest) (string, []client.EventInfo, error) {
|
|
|
- selectJsonBytes, err := json.Marshal(req.Select)
|
|
|
- if err != nil {
|
|
|
- return "", nil, err
|
|
|
+ var selectJsonBytes []byte
|
|
|
+ if req.Select != nil {
|
|
|
+ innerJsonBytes, err := req.Select.ToJson()
|
|
|
+ if err != nil {
|
|
|
+ return "", nil, err
|
|
|
+ }
|
|
|
+
|
|
|
+ selectJsonBytes = innerJsonBytes
|
|
|
}
|
|
|
|
|
|
reply, err := c.eventQueryServiceClient.CommonEventHistoryQueryOnly(context.Background(), &request.CommonEventQueryRequest{
|