Port all of the arcgis schema to using jet
Have not tested anything at this point, it just compiles.
This commit is contained in:
parent
89ed2003fa
commit
bab3200b6c
52 changed files with 479 additions and 13585 deletions
24
db/query/arcgis/account.go
Normal file
24
db/query/arcgis/account.go
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
package arcgis
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/Gleipnir-Technology/bob"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/arcgis/model"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db/gen/nidus-sync/arcgis/table"
|
||||
"github.com/go-jet/jet/v2/postgres"
|
||||
)
|
||||
|
||||
func AccountFromID(ctx context.Context, org_id string) (*model.Account, error) {
|
||||
statement := table.Account.SELECT(
|
||||
table.Account.AllColumns,
|
||||
).FROM(table.Account).
|
||||
WHERE(table.Account.ID.EQ(postgres.String(org_id)))
|
||||
return db.ExecuteOne[model.Account](ctx, statement)
|
||||
}
|
||||
func AccountInsert(ctx context.Context, txn bob.Tx, m *model.Account) (*model.Account, error) {
|
||||
statement := table.Account.INSERT(table.Account.AllColumns).
|
||||
MODEL(m)
|
||||
return db.ExecuteOneTx[model.Account](ctx, txn, statement)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue