github.com/matrixorigin/matrixone@v1.2.0/pkg/stream/connector/converter_test.go (about) 1 // Copyright 2021 - 2023 Matrix Origin 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 package moconnector 16 17 import ( 18 "testing" 19 ) 20 21 func TestSQLConverter_Convert(t *testing.T) { 22 //c := newSQLConverter("d1", "t1") 23 //type testCase struct { 24 // obj RawObject 25 // sql string 26 //} 27 //var cases = []testCase{ 28 // { 29 // obj: map[string]any{"k1": "v1"}, 30 // sql: "INSERT INTO d1.t1 (k1) VALUES('v1')", 31 // }, 32 // { 33 // obj: map[string]any{"k1": "v1", "k2": 20}, 34 // sql: "INSERT INTO d1.t1 (k1, k2) VALUES('v1', 20)", 35 // }, 36 // { 37 // obj: map[string]any{"k1": "v1", "k2": 20.3}, 38 // sql: "INSERT INTO d1.t1 (k1, k2) VALUES('v1', 20.3)", 39 // }, 40 // { 41 // obj: map[string]any{"k1": "v1", "k2": 20.3, "k3": false}, 42 // sql: "INSERT INTO d1.t1 (k1, k2, k3) VALUES('v1', 20.3, 0)", 43 // }, 44 //} 45 // 46 //for _, ca := range cases { 47 // _, err := c.Convert(context.Background(), ca.obj) 48 // assert.NoError(t, err) 49 //} 50 }