From 2bd0377af7365869dea8a0d08bf521579e1a1e4e Mon Sep 17 00:00:00 2001 From: x-ream <8966188@qq.com> Date: Wed, 10 Jul 2024 22:08:18 +0800 Subject: [PATCH] InsertBuilder, UpsertBuilder support write []byte (#77) --- bytes_support.go | 25 ------------------------- sqlxb_test.go | 11 ++--------- 2 files changed, 2 insertions(+), 34 deletions(-) delete mode 100644 bytes_support.go diff --git a/bytes_support.go b/bytes_support.go deleted file mode 100644 index 64bd6b6..0000000 --- a/bytes_support.go +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright 2020 io.xream.sqlxb -// -// Licensed to the Apache Software Foundation (ASF) under one or more -// contributor license agreements. See the NOTICE file distributed with -// this work for additional information regarding copyright ownership. -// The ASF licenses this file to You under the Apache License, Version 2.0 -// (the "License"); you may not use this file except in compliance with -// the License. You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -package sqlxb - -type BytesSupport struct { - Body []byte -} - -func Bytes(body []byte) *BytesSupport { - return &BytesSupport{Body: body} -} diff --git a/sqlxb_test.go b/sqlxb_test.go index 6f8648e..ef779dd 100644 --- a/sqlxb_test.go +++ b/sqlxb_test.go @@ -1,7 +1,6 @@ package sqlxb import ( - "encoding/json" "fmt" "strings" "testing" @@ -26,16 +25,9 @@ func TestInsert(t *testing.T) { t.Run("insert", func(t *testing.T) { - str := "eHh4eHh4eHh4eHg=" - buffer, _ := json.Marshal(str) - fmt.Println("-------------") - fmt.Println(string(buffer)) - fmt.Println("+++++++++++++") - mm := make(map[string]string) mm["xxxx"] = "zzzzz" body := []byte("xxxxxxxxxxx") - fmt.Println(string(body)) var po Pet sql, vs := Of(&po). @@ -72,7 +64,8 @@ func TestUpdate(t *testing.T) { b.Set("one", Cat{ Id: 2, M: mm, - }) + }). + Set("body", []byte("yyyyyyyyyyyy")) }). Eq("id", 2). Build().