@@ -9,10 +9,10 @@ import (
99 "runtime/debug"
1010 "testing"
1111
12- "github.com/jackc/pgx/v5/pgxpool "
12+ "github.com/specterops/dawgs/database "
1313
1414 "github.com/specterops/dawgs"
15- "github.com/specterops/dawgs/drivers /pg"
15+ "github.com/specterops/dawgs/database /pg"
1616 "github.com/specterops/dawgs/graph"
1717 "github.com/specterops/dawgs/util/size"
1818 "github.com/stretchr/testify/require"
@@ -32,34 +32,25 @@ func TestTranslationTestCases(t *testing.T) {
3232
3333 require .NotEmpty (t , pgConnectionStr )
3434
35- if pgxPool , err := pgxpool .New (testCtx , pgConnectionStr ); err != nil {
36- t .Fatalf ("Failed opening database connection: %v" , err )
37- } else if connection , err := dawgs .Open (context .TODO (), pg .DriverName , dawgs.Config {
35+ if connection , err := dawgs .Open (context .TODO (), pg .DriverName , dawgs.Config {
3836 GraphQueryMemoryLimit : size .Gibibyte ,
39- Pool : pgxPool ,
37+ ConnectionString : pgConnectionStr ,
4038 }); err != nil {
4139 t .Fatalf ("Failed opening database connection: %v" , err )
42- } else if pgConnection , typeOK := connection .(* pg.Driver ); ! typeOK {
43- t .Fatalf ("Invalid connection type: %T" , connection )
4440 } else {
4541 defer connection .Close (testCtx )
4642
47- graphSchema := graph.Schema {
48- Graphs : []graph.Graph {{
49- Name : "test" ,
50- Nodes : graph.Kinds {
51- graph .StringKind ("NodeKind1" ),
52- graph .StringKind ("NodeKind2" ),
53- },
54- Edges : graph.Kinds {
55- graph .StringKind ("EdgeKind1" ),
56- graph .StringKind ("EdgeKind2" ),
57- },
58- }},
59- DefaultGraph : graph.Graph {
60- Name : "test" ,
43+ graphSchema := database .NewSchema ("test" , database.Graph {
44+ Name : "test" ,
45+ Nodes : graph.Kinds {
46+ graph .StringKind ("NodeKind1" ),
47+ graph .StringKind ("NodeKind2" ),
6148 },
62- }
49+ Edges : graph.Kinds {
50+ graph .StringKind ("EdgeKind1" ),
51+ graph .StringKind ("EdgeKind2" ),
52+ },
53+ })
6354
6455 if err := connection .AssertSchema (testCtx , graphSchema ); err != nil {
6556 t .Fatalf ("Failed asserting graph schema: %v" , err )
@@ -79,7 +70,7 @@ func TestTranslationTestCases(t *testing.T) {
7970 }
8071 }()
8172
82- testCase .AssertLive (testCtx , t , pgConnection )
73+ testCase .AssertLive (testCtx , t , connection )
8374 })
8475
8576 casesRun += 1
0 commit comments