Get back to compiling, but using new jet for publicreport
This was an epically long change, and a terrible idea, but it compiles. This was essentially a cascade that came about because I can't blend jet and bob in the same transaction. In for a penny, I guess...
This commit is contained in:
parent
a95e44cf42
commit
fcd95f1a25
65 changed files with 3129 additions and 3457 deletions
|
|
@ -4,21 +4,18 @@ import (
|
|||
"context"
|
||||
"fmt"
|
||||
|
||||
"github.com/Gleipnir-Technology/bob"
|
||||
//"github.com/Gleipnir-Technology/bob/dialect/psql"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db/models"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db"
|
||||
querypublic "github.com/Gleipnir-Technology/nidus-sync/db/query/public"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/platform/types"
|
||||
)
|
||||
|
||||
func loadAddresses(ctx context.Context, txn bob.Executor, address_ids []int32) (results map[int32]types.Address, err error) {
|
||||
rows, err := models.Addresses.Query(
|
||||
models.SelectWhere.Addresses.ID.In(address_ids...),
|
||||
).All(ctx, txn)
|
||||
func loadAddresses(ctx context.Context, txn db.Tx, address_ids []int64) (results map[int32]types.Address, err error) {
|
||||
addresses, err := querypublic.AddressesFromIDs(ctx, txn, address_ids)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("query addresses: %w", err)
|
||||
}
|
||||
results = make(map[int32]types.Address, len(rows))
|
||||
for _, row := range rows {
|
||||
results = make(map[int32]types.Address, len(addresses))
|
||||
for _, row := range addresses {
|
||||
results[row.ID] = types.AddressFromModel(row)
|
||||
}
|
||||
return results, nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue