Skip to content

Commit

Permalink
chore: BED-5168 - prepare for review
Browse files Browse the repository at this point in the history
  • Loading branch information
zinic committed Dec 18, 2024
1 parent 0f28412 commit 92421d0
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 8 deletions.
3 changes: 2 additions & 1 deletion cmd/api/src/api/v2/integration/ingest.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ package integration

import (
"encoding/json"
"github.com/specterops/bloodhound/graphschema"
"strings"
"time"

"github.com/specterops/bloodhound/graphschema"

"github.com/specterops/bloodhound/dawgs/graph"
"github.com/specterops/bloodhound/src/model"
"github.com/specterops/bloodhound/src/model/appcfg"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -585,3 +585,11 @@ with s0 as (select (n0.id, n0.kind_ids, n0.properties)::nodecomposite as n0
and coalesce(n0.properties -> 'a', n0.properties -> 'b')::int8 = 1)
select s0.n0 as n
from s0;

-- case: match (n:NodeKind1) where 1 = coalesce(n.a, n.b) return n
with s0 as (select (n0.id, n0.kind_ids, n0.properties)::nodecomposite as n0
from node n0
where n0.kind_ids operator (pg_catalog.&&) array [1]::int2[]
and 1 = coalesce(n0.properties -> 'a', n0.properties -> 'b')::int8)
select s0.n0 as n
from s0;
3 changes: 2 additions & 1 deletion packages/go/cypher/models/pgsql/translate/translator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ package translate_test

import (
"fmt"
"github.com/specterops/bloodhound/dawgs/drivers/pg/pgutil"
"testing"

"github.com/specterops/bloodhound/dawgs/drivers/pg/pgutil"

"github.com/specterops/bloodhound/cypher/models/pgsql"
"github.com/specterops/bloodhound/cypher/models/pgsql/test"
"github.com/specterops/bloodhound/dawgs/graph"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ package visualization
import (
"bytes"
"context"
"github.com/specterops/bloodhound/dawgs/drivers/pg/pgutil"
"testing"

"github.com/specterops/bloodhound/dawgs/drivers/pg/pgutil"

"github.com/specterops/bloodhound/cypher/frontend"
"github.com/specterops/bloodhound/cypher/models/pgsql/translate"
"github.com/stretchr/testify/require"
Expand Down
4 changes: 0 additions & 4 deletions packages/go/dawgs/drivers/pg/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ import (
"strings"
"sync"

"github.com/specterops/bloodhound/log"

"github.com/jackc/pgx/v5"
"github.com/specterops/bloodhound/dawgs/drivers/pg/model"
"github.com/specterops/bloodhound/dawgs/drivers/pg/query"
Expand Down Expand Up @@ -61,8 +59,6 @@ func NewSchemaManager(database graph.Database) *SchemaManager {
}

func (s *SchemaManager) fetch(tx graph.Transaction) error {
log.Infof("fetching kinds from database")

if kinds, err := query.On(tx).SelectKinds(); err != nil {
return err
} else {
Expand Down
3 changes: 2 additions & 1 deletion packages/go/dawgs/drivers/pg/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ package pg

import (
"context"
"github.com/specterops/bloodhound/dawgs/drivers/pg/pgutil"
"testing"

"github.com/specterops/bloodhound/dawgs/drivers/pg/pgutil"

"github.com/specterops/bloodhound/dawgs/graph"
graph_mocks "github.com/specterops/bloodhound/dawgs/graph/mocks"
"github.com/specterops/bloodhound/dawgs/query"
Expand Down
1 change: 1 addition & 0 deletions packages/go/dawgs/drivers/pg/pgutil/kindmapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package pgutil
import (
"context"
"fmt"

"github.com/specterops/bloodhound/dawgs/graph"
)

Expand Down

0 comments on commit 92421d0

Please sign in to comment.