Skip to content

Commit

Permalink
start implement json load
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewpeterkort committed Nov 1, 2024
1 parent 5f507f8 commit c1ee086
Show file tree
Hide file tree
Showing 11 changed files with 782 additions and 352 deletions.
2 changes: 2 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
_ "net/http/pprof" // enable pprof via a flag
"os"

"github.com/bmeg/grip/cmd/caliperload"

Check failure on line 9 in cmd/root.go

View workflow job for this annotation

GitHub Actions / build

no required module provides package github.com/bmeg/grip/cmd/caliperload; to add it:
"github.com/bmeg/grip/cmd/create"
"github.com/bmeg/grip/cmd/delete"
"github.com/bmeg/grip/cmd/drop"
Expand Down Expand Up @@ -60,6 +61,7 @@ func init() {
RootCmd.AddCommand(job.Cmd)
RootCmd.AddCommand(load.Cmd)
RootCmd.AddCommand(mongoload.Cmd)
RootCmd.AddCommand(caliperload.Cmd)
RootCmd.AddCommand(query.Cmd)
RootCmd.AddCommand(erclient.Cmd)
RootCmd.AddCommand(rdf.Cmd)
Expand Down
12 changes: 6 additions & 6 deletions cmd/schema/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ var getCmd = &cobra.Command{
},
}

var loadPrimitiveSchemafromJsonSchema = &cobra.Command{
var loadGqlSchemafromJsonSchema = &cobra.Command{
Use: "load",
Short: "Load graph schemas",
Long: ``,
Expand Down Expand Up @@ -221,12 +221,12 @@ func init() {
pflags.StringVar(&yamlSchemaDir, "yamlSchemaDir", "", "Name of YAML schemas dir")
pflags.StringVar(&graphName, "graphName", "", "Name of schemaGraph")

sflags := loadPrimitiveSchemafromJsonSchema.Flags()
sflags.StringVar(&jsonSchemaFile, "jsonSchema", "", "Json Schema")
sflags.StringVar(&yamlSchemaDir, "yamlSchemaDir", "", "Name of YAML schemas dir")
sflags.StringVar(&graphName, "graphName", "", "Name of schemaGraph")
gqlflags := loadGqlSchemafromJsonSchema.Flags()
gqlflags.StringVar(&jsonSchemaFile, "jsonSchema", "", "Json Schema")
gqlflags.StringVar(&yamlSchemaDir, "yamlSchemaDir", "", "Name of YAML schemas dir")
gqlflags.StringVar(&graphName, "graphName", "", "Name of schemaGraph")

Cmd.AddCommand(loadPrimitiveSchemafromJsonSchema)
Cmd.AddCommand(loadGqlSchemafromJsonSchema)
Cmd.AddCommand(getCmd)
Cmd.AddCommand(postCmd)
}
Binary file added gripql/.DS_Store
Binary file not shown.
15 changes: 15 additions & 0 deletions gripql/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,21 @@ func (client Client) BulkAdd(elemChan chan *GraphElement) error {
return err
}

func (client Client) BulkAddRaw(elemChan chan *RawJson) error {
sc, err := client.EditC.BulkAddRaw(context.Background())
if err != nil {
return err
}
for elem := range elemChan {
err := sc.Send(elem)
if err != nil {
return err
}
}
_, err = sc.CloseAndRecv()
return err
}

func (client Client) BulkDelete(delete *DeleteData) error {
_, err := client.EditC.BulkDelete(context.Background(), delete)
return err
Expand Down
78 changes: 78 additions & 0 deletions gripql/gripql.pb.dgw.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c1ee086

Please sign in to comment.