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
53
cmd/test-jet/main.go
Normal file
53
cmd/test-jet/main.go
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"os"
|
||||
|
||||
"github.com/Gleipnir-Technology/nidus-sync/config"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db"
|
||||
"github.com/Gleipnir-Technology/nidus-sync/db/query/public"
|
||||
)
|
||||
|
||||
func main() {
|
||||
err := config.Parse()
|
||||
if err != nil {
|
||||
log.Printf("failed on config: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
ctx := context.TODO()
|
||||
err = db.InitializeDatabase(ctx, config.PGDSN)
|
||||
if err != nil {
|
||||
log.Printf("failed on db: %v", err)
|
||||
os.Exit(2)
|
||||
}
|
||||
|
||||
txn, err := db.BeginTxn(ctx)
|
||||
if err != nil {
|
||||
log.Printf("failed on txn: %v", err)
|
||||
os.Exit(3)
|
||||
}
|
||||
defer txn.Rollback(ctx)
|
||||
log.Printf("doing address")
|
||||
gid := "openaddresses:address:us/ca/tulare-addresses-county:0dc28458fd03e3fa"
|
||||
address, err := public.AddressFromGID(ctx, txn, gid)
|
||||
if err != nil {
|
||||
log.Printf("failed on query: %v", err)
|
||||
os.Exit(4)
|
||||
}
|
||||
//log.Printf("address %d lat %f lng %f", address.ID, *address.LocationLatitude, *address.LocationLongitude)
|
||||
log.Printf("Address id %d location %s, lat %f, lng %f", address.ID, address.Location, *address.LocationLatitude, *address.LocationLongitude)
|
||||
txn.Commit(ctx)
|
||||
|
||||
/*
|
||||
log.Printf("doing comm")
|
||||
id := int64(1)
|
||||
comm, err := public.CommunicationFromID(ctx, id)
|
||||
if err != nil {
|
||||
log.Printf("failed on query: %v", err)
|
||||
os.Exit(4)
|
||||
}
|
||||
log.Printf("communication %d", comm.ID)
|
||||
*/
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue