Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ If brew version does not work, download from https://github.com/golangci/golangc

### Database ORM

This is using [sqlboiler](https://github.com/volatiletech/sqlboiler). The ORM models are code generated. If the db changes,
This is using [sqlboiler](https://github.com/aarondl/sqlboiler). The ORM models are code generated. If the db changes,
you must update the models.

Make sure you have sqlboiler installed:

```bash
go install github.com/volatiletech/sqlboiler/v4@latest
go install github.com/volatiletech/sqlboiler/v4/drivers/sqlboiler-psql@latest
go install github.com/aarondl/sqlboiler/v4@latest
go install github.com/aarondl/sqlboiler/v4/drivers/sqlboiler-psql@latest
```

To generate the models:
Expand Down
4 changes: 2 additions & 2 deletions cmd/device-definitions-api/add_vin.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import (
"github.com/DIMO-Network/shared/pkg/db"
stringutils "github.com/DIMO-Network/shared/pkg/strings"
vinutils "github.com/DIMO-Network/shared/pkg/vin"
"github.com/aarondl/null/v8"
"github.com/aarondl/sqlboiler/v4/boil"
"github.com/google/subcommands"
"github.com/pkg/errors"
"github.com/rs/zerolog"
"github.com/volatiletech/null/v8"
"github.com/volatiletech/sqlboiler/v4/boil"
)

type addVINCmd struct {
Expand Down
14 changes: 7 additions & 7 deletions cmd/device-definitions-api/decode_vin.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import (
"github.com/DIMO-Network/device-definitions-api/internal/infrastructure/db/models"
"github.com/DIMO-Network/shared/pkg/db"
vinutil "github.com/DIMO-Network/shared/pkg/vin"
"github.com/aarondl/null/v8"
"github.com/aarondl/sqlboiler/v4/boil"
"github.com/ethereum/go-ethereum/ethclient"
"github.com/volatiletech/null/v8"
"github.com/volatiletech/sqlboiler/v4/boil"

"github.com/goccy/go-json"

Expand Down Expand Up @@ -116,7 +116,7 @@ func (p *decodeVINCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interf
vinInfo := &coremodels.VINDecodingInfoData{VIN: vin}

if p.datGroup {
vinInfo, err = vinDecodingService.GetVIN(ctx, vin, coremodels.DATGroupProvider, country)
vinInfo, _, err = vinDecodingService.GetVIN(ctx, vin, coremodels.DATGroupProvider, country)
// use the dat group service to decode
if err != nil {
fmt.Println(err.Error())
Expand All @@ -126,7 +126,7 @@ func (p *decodeVINCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interf
fmt.Printf("\n\nVIN Response: %+v\n", vinInfo)
}
if p.drivly {
vinInfo, err = vinDecodingService.GetVIN(ctx, vin, coremodels.DrivlyProvider, country)
vinInfo, _, err = vinDecodingService.GetVIN(ctx, vin, coremodels.DrivlyProvider, country)
if err != nil {
fmt.Println(err.Error())
continue
Expand All @@ -135,23 +135,23 @@ func (p *decodeVINCmd) Execute(ctx context.Context, f *flag.FlagSet, _ ...interf
fmt.Printf("VIN Response: %+v\n", vinInfo)
}
if p.vincario {
vinInfo, err = vinDecodingService.GetVIN(ctx, vin, coremodels.VincarioProvider, country)
vinInfo, _, err = vinDecodingService.GetVIN(ctx, vin, coremodels.VincarioProvider, country)
if err != nil {
fmt.Println(err.Error())
continue
}
fmt.Printf("VIN Response: %+v\n", vinInfo)
}
if p.carvx {
vinInfo, err = vinDecodingService.GetVIN(ctx, vin, coremodels.CarVXVIN, country)
vinInfo, _, err = vinDecodingService.GetVIN(ctx, vin, coremodels.CarVXVIN, country)
if err != nil {
fmt.Println(err.Error())
continue
}
fmt.Printf("VIN Response: %+v\n", vinInfo)
}
if p.japan17vin {
vinInfo, err = vinDecodingService.GetVIN(ctx, vin, coremodels.Japan17VIN, country)
vinInfo, _, err = vinDecodingService.GetVIN(ctx, vin, coremodels.Japan17VIN, country)
if err != nil {
fmt.Println(err.Error())
continue
Expand Down
2 changes: 1 addition & 1 deletion cmd/device-definitions-api/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type migrateDBCmd struct {
func (*migrateDBCmd) Name() string { return "migrate" }
func (*migrateDBCmd) Synopsis() string { return "migrate args to stdout." }
func (*migrateDBCmd) Usage() string {
return `migrate [-up-to|-down-to] <some text>:
return `migrate [-up|-down] <some text>:
migrate args.
`
}
Expand Down
Loading
Loading