(t *testing.T)
| 35 | } |
| 36 | |
| 37 | func TestLargeObjectsSimpleProtocol(t *testing.T) { |
| 38 | // We use a very short limit to test chunking logic. |
| 39 | pgx.SetMaxLargeObjectMessageLength(t, 2) |
| 40 | |
| 41 | ctx, cancel := context.WithTimeout(context.Background(), 120*time.Second) |
| 42 | defer cancel() |
| 43 | |
| 44 | config, err := pgx.ParseConfig(os.Getenv("PGX_TEST_DATABASE")) |
| 45 | if err != nil { |
| 46 | t.Fatal(err) |
| 47 | } |
| 48 | |
| 49 | config.DefaultQueryExecMode = pgx.QueryExecModeSimpleProtocol |
| 50 | |
| 51 | conn, err := pgx.ConnectConfig(ctx, config) |
| 52 | if err != nil { |
| 53 | t.Fatal(err) |
| 54 | } |
| 55 | |
| 56 | pgxtest.SkipCockroachDB(t, conn, "Server does support large objects") |
| 57 | |
| 58 | tx, err := conn.Begin(ctx) |
| 59 | if err != nil { |
| 60 | t.Fatal(err) |
| 61 | } |
| 62 | |
| 63 | testLargeObjects(t, ctx, tx) |
| 64 | } |
| 65 | |
| 66 | func testLargeObjects(t *testing.T, ctx context.Context, tx pgx.Tx) { |
| 67 | lo := tx.LargeObjects() |
nothing calls this directly
no test coverage detected