MCPcopy
hub / github.com/jackc/pgx / Unlink

Method Unlink

large_objects.go:49–61  ·  view source on GitHub ↗

Unlink removes a large object from the database.

(ctx context.Context, oid uint32)

Source from the content-addressed store, hash-verified

47
48// Unlink removes a large object from the database.
49func (o *LargeObjects) Unlink(ctx context.Context, oid uint32) error {
50 var result int32
51 err := o.tx.QueryRow(ctx, "select lo_unlink($1)", oid).Scan(&result)
52 if err != nil {
53 return err
54 }
55
56 if result != 1 {
57 return errors.New("failed to remove large object")
58 }
59
60 return nil
61}
62
63// A LargeObject is a large object stored on the server. It is only valid within the transaction that it was initialized
64// in. It uses the context it was initialized with for all operations. It implements these interfaces:

Callers 2

testLargeObjectsFunction · 0.80

Calls 2

ScanMethod · 0.65
QueryRowMethod · 0.65

Tested by 2

testLargeObjectsFunction · 0.64