Derived tabled func

This commit is contained in:
2025-10-22 12:22:26 +05:30
parent 2551e07b3e
commit bb6a45732f
3 changed files with 18 additions and 11 deletions

View File

@@ -1,11 +0,0 @@
package db
import "code.patial.tech/go/pgm"
func DerivedTable(tblName string, fromQry pgm.Query) pgm.Table {
t := pgm.Table{
Name: tblName,
DerivedTable: fromQry,
}
return t
}

View File

@@ -12,3 +12,11 @@ var (
Comment = pgm.Table{Name: "comments", FieldCount: 5}
Employee = pgm.Table{Name: "employees", FieldCount: 5}
)
func DerivedTable(tblName string, fromQry pgm.Query) pgm.Table {
t := pgm.Table{
Name: tblName,
DerivedTable: fromQry,
}
return t
}