suppression des traces
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
|||||||
"database/sql"
|
"database/sql"
|
||||||
"fmt"
|
"fmt"
|
||||||
"reflect"
|
"reflect"
|
||||||
"strings"
|
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -17,8 +16,6 @@ type dbfield struct {
|
|||||||
type Dialect interface {
|
type Dialect interface {
|
||||||
TableExists(db *sql.DB, tableName string) (bool, error)
|
TableExists(db *sql.DB, tableName string) (bool, error)
|
||||||
ColumnSpec(f dbfield) (string, error)
|
ColumnSpec(f dbfield) (string, error)
|
||||||
// ScanResult scans a single row into the provided destination slice
|
|
||||||
// The row parameter can be *sql.Row or *sql.Rows, both implement Scan(dest ...any) error
|
|
||||||
ScanResult(row interface{ Scan(dest ...any) error }, fields []any, fieldTypes []dbfield) error
|
ScanResult(row interface{ Scan(dest ...any) error }, fields []any, fieldTypes []dbfield) error
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +45,6 @@ func NewTable[T any](db *sql.DB, dialect Dialect, tablename string) (Table[T], e
|
|||||||
stype: field.Type.String(),
|
stype: field.Type.String(),
|
||||||
dbname: field.Tag.Get("db"),
|
dbname: field.Tag.Get("db"),
|
||||||
}
|
}
|
||||||
fmt.Println(f.name, f.stype, f.dbname)
|
|
||||||
fields = append(fields, f)
|
fields = append(fields, f)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,7 +77,6 @@ func (t Table[T]) Sync() error {
|
|||||||
}
|
}
|
||||||
columns[i] = c
|
columns[i] = c
|
||||||
}
|
}
|
||||||
sql := fmt.Sprintf("create table %s (%s)", t.tablename, strings.Join(columns, ","))
|
|
||||||
_, err := t.db.Exec(sql)
|
_, err := t.db.Exec(sql)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|||||||
Reference in New Issue
Block a user