MCPcopy
hub / github.com/openfga/openfga / TestPostgresDatastore

Function TestPostgresDatastore

pkg/storage/postgres/postgres_test.go:95–113  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

93}
94
95func TestPostgresDatastore(t *testing.T) {
96 testDatastore := storagefixtures.RunDatastoreTestContainer(t, "postgres")
97
98 uri := testDatastore.GetConnectionURI(true)
99 cfg := sqlcommon.NewConfig()
100 ds, err := New(uri, cfg)
101 require.NoError(t, err)
102 defer ds.Close()
103 test.RunAllTests(t, ds)
104
105 // Run tests with a custom large max_tuples_per_write value.
106 dsCustom, err := New(uri, sqlcommon.NewConfig(
107 sqlcommon.WithMaxTuplesPerWrite(5000),
108 ))
109 require.NoError(t, err)
110 defer dsCustom.Close()
111
112 t.Run("WriteTuplesWithMaxTuplesPerWrite", test.WriteTuplesWithMaxTuplesPerWrite(dsCustom, context.Background()))
113}
114
115// TestWriteWithSimpleProtocol is a regression test for a bug where Write operations
116// failed with "invalid input syntax for type integer: TUPLE_OPERATION_WRITE" (SQLSTATE 22P02)

Callers

nothing calls this directly

Calls 8

NewConfigFunction · 0.92
RunAllTestsFunction · 0.92
WithMaxTuplesPerWriteFunction · 0.92
RunMethod · 0.80
NewFunction · 0.70
GetConnectionURIMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…