summaryrefslogtreecommitdiff
path: root/DAL/DB/CRUD.go
diff options
context:
space:
mode:
authorPhysick <96335032+DegustatorPonos@users.noreply.github.com>2025-11-29 20:25:00 +0500
committerPhysick <96335032+DegustatorPonos@users.noreply.github.com>2025-11-29 20:25:00 +0500
commit757e8534d1651965f55610d96f93c952a377f3c9 (patch)
tree072a70860f1ab8c68c7708f85a00b35d9215fdc9 /DAL/DB/CRUD.go
parente07dca81d05f304865a59c8afee98a3cde8bce8c (diff)
Added tags to reflection
Diffstat (limited to 'DAL/DB/CRUD.go')
-rw-r--r--DAL/DB/CRUD.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/DAL/DB/CRUD.go b/DAL/DB/CRUD.go
index a3b4a24..51ef908 100644
--- a/DAL/DB/CRUD.go
+++ b/DAL/DB/CRUD.go
@@ -30,7 +30,12 @@ func (self *DataTable[T]) getFields() []string {
var zero T
var outp = make([]string, 0)
for _, f := range reflect.VisibleFields(reflect.TypeOf(zero)) {
- outp = append(outp, f.Name)
+ var tag, exists = f.Tag.Lookup("sql")
+ if exists {
+ outp = append(outp, tag)
+ } else {
+ outp = append(outp, f.Name)
+ }
}
return outp
}