Implement DML func and related tests
Go Tests / test (push) Failing after 6s

This commit is contained in:
2026-05-04 21:33:29 +02:00
parent 852b5e5888
commit 01336bb911
11 changed files with 538 additions and 38 deletions
+2 -2
View File
@@ -13,14 +13,14 @@ type Parser struct {
Table *Table
}
func NewParser(obj any) *Parser {
func NewParser[T any](obj T) *Parser {
objType := reflect.TypeOf(obj)
return &Parser{typ: objType}
}
// This is step 1 of the parsing, it creates the table instance and
func (p *Parser) ParseColumns() *Table {
table := Table{Name: camelToSnake(p.typ.Name()), TypeName: p.typ.Name()}
table := Table{Name: camelToSnake(p.typ.Name()), Type: p.typ}
var columns []Column
for field := range p.typ.Fields() {