This commit is contained in:
parent
496b9b34bc
commit
71463433e7
1 changed files with 20 additions and 0 deletions
20
db/query/public/user.go
Normal file
20
db/query/public/user.go
Normal file
|
|
@ -0,0 +1,20 @@
|
||||||
|
package public
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
//"github.com/Gleipnir-Technology/bob"
|
||||||
|
"github.com/Gleipnir-Technology/nidus-sync/db"
|
||||||
|
//"github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/public/enum"
|
||||||
|
"github.com/Gleipnir-Technology/jet/postgres"
|
||||||
|
"github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/public/model"
|
||||||
|
"github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/public/table"
|
||||||
|
)
|
||||||
|
|
||||||
|
func UsersFromOrganizationID(ctx context.Context, txn db.Ex, org_id int64) ([]model.User, error) {
|
||||||
|
statement := table.User.SELECT(
|
||||||
|
table.User.AllColumns,
|
||||||
|
).FROM(table.User).
|
||||||
|
WHERE(table.User.OrganizationID.EQ(postgres.Int(org_id)))
|
||||||
|
return db.ExecuteManyTx[model.User](ctx, txn, statement)
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue