Compare commits

..

No commits in common. "030343bc01eec563dfbf280c6d53090eace053ae" and "41c2b5d2114e508597a79496eba42733193ac697" have entirely different histories.

8 changed files with 13 additions and 12 deletions

2
go.mod
View File

@ -1,3 +1,3 @@
module codeup.manabox.cn/public/tdengine-mapper-go
module manabox.cn/tdengine-mapper
go 1.18

View File

@ -1,4 +1,4 @@
package tdmap
package td_builder
import (
"database/sql"

View File

@ -1,12 +1,13 @@
package tdmap
package td_builder
import (
"fmt"
"manabox.cn/tdengine-mapper/syncmap"
"reflect"
"strings"
)
func NewMapping() *TdMapping {
func NewTdMapping() *TdMapping {
return &TdMapping{}
}
@ -16,7 +17,7 @@ type TableNamer interface {
}
type TdMapping struct {
modelMates Map[string, *StructMate]
modelMates syncmap.Map[string, *StructMate]
}
func (b *TdMapping) scanStruct(data ...any) error {

View File

@ -1,4 +1,4 @@
package tdmap
package td_builder
import (
"database/sql"
@ -49,7 +49,7 @@ func (s *TaosUser) TableName() string {
}
func TestBuilderInsert(t *testing.T) {
tdMapping := NewMapping()
tdMapping := NewTdMapping()
p := 1
data := []any{
&TaosDevice{
@ -113,7 +113,7 @@ func (u *User) SuperTableName() string {
}
func TestSimpleInsert(t *testing.T) {
tdMapping := NewMapping()
tdMapping := NewTdMapping()
data := []any{
&User{Name: "张三", Age: 18},
&User{Name: "李四", Age: 20},

View File

@ -1,4 +1,4 @@
package tdmap
package td_builder
import (
"fmt"

View File

@ -1,4 +1,4 @@
package tdmap
package syncmap
import (
"sync"

View File

@ -1,4 +1,4 @@
package tdmap
package syncmap
import (
"log"

View File

@ -1,4 +1,4 @@
package tdmap
package td_builder
type TableRowMateria struct {
SuperTableName string