Name PG types as words
Though this doesn't follow Go naming conventions exactly it makes names more consistent with PostgreSQL and it is easier to read. For example, TIDOID becomes TidOid. In addition this is one less breaking change in the move to V3.
This commit is contained in:
+6
-6
@@ -59,20 +59,20 @@ const (
|
||||
)
|
||||
|
||||
// Create creates a new large object. If id is zero, the server assigns an
|
||||
// unused OID.
|
||||
func (o *LargeObjects) Create(id OID) (OID, error) {
|
||||
newOID, err := fpInt32(o.fp.CallFn("lo_create", []fpArg{fpIntArg(int32(id))}))
|
||||
return OID(newOID), err
|
||||
// unused Oid.
|
||||
func (o *LargeObjects) Create(id Oid) (Oid, error) {
|
||||
newOid, err := fpInt32(o.fp.CallFn("lo_create", []fpArg{fpIntArg(int32(id))}))
|
||||
return Oid(newOid), err
|
||||
}
|
||||
|
||||
// Open opens an existing large object with the given mode.
|
||||
func (o *LargeObjects) Open(oid OID, mode LargeObjectMode) (*LargeObject, error) {
|
||||
func (o *LargeObjects) Open(oid Oid, mode LargeObjectMode) (*LargeObject, error) {
|
||||
fd, err := fpInt32(o.fp.CallFn("lo_open", []fpArg{fpIntArg(int32(oid)), fpIntArg(int32(mode))}))
|
||||
return &LargeObject{fd: fd, lo: o}, err
|
||||
}
|
||||
|
||||
// Unlink removes a large object from the database.
|
||||
func (o *LargeObjects) Unlink(oid OID) error {
|
||||
func (o *LargeObjects) Unlink(oid Oid) error {
|
||||
_, err := o.fp.CallFn("lo_unlink", []fpArg{fpIntArg(int32(oid))})
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user