package pgtype

import (
	
	
)
ACLItem is used for PostgreSQL's aclitem data type. A sample aclitem might look like this: postgres=arwdDxt/postgres Note, however, that because the user/role name part of an aclitem is an identifier, it follows all the usual formatting rules for SQL identifiers: if it contains spaces and other special characters, it should appear in double-quotes: postgres=arwdDxt/"role with spaces"
type ACLItem struct {
	String string
	Status Status
}

func ( *ACLItem) ( interface{}) error {
	if  == nil {
		* = ACLItem{Status: Null}
		return nil
	}

	if ,  := .(interface{ () interface{} });  {
		 := .()
		if  !=  {
			return .()
		}
	}

	switch value := .(type) {
	case string:
		* = ACLItem{String: , Status: Present}
	case *string:
		if  == nil {
			* = ACLItem{Status: Null}
		} else {
			* = ACLItem{String: *, Status: Present}
		}
	default:
		if ,  := underlyingStringType();  {
			return .()
		}
		return fmt.Errorf("cannot convert %v to ACLItem", )
	}

	return nil
}

func ( ACLItem) () interface{} {
	switch .Status {
	case Present:
		return .String
	case Null:
		return nil
	default:
		return .Status
	}
}

func ( *ACLItem) ( interface{}) error {
	switch .Status {
	case Present:
		switch v := .(type) {
		case *string:
			* = .String
			return nil
		default:
			if ,  := GetAssignToDstType();  {
				return .()
			}
			return fmt.Errorf("unable to assign to %T", )
		}
	case Null:
		return NullAssignTo()
	}

	return fmt.Errorf("cannot decode %#v into %T", , )
}

func ( *ACLItem) ( *ConnInfo,  []byte) error {
	if  == nil {
		* = ACLItem{Status: Null}
		return nil
	}

	* = ACLItem{String: string(), Status: Present}
	return nil
}

func ( ACLItem) ( *ConnInfo,  []byte) ([]byte, error) {
	switch .Status {
	case Null:
		return nil, nil
	case Undefined:
		return nil, errUndefined
	}

	return append(, .String...), nil
}
Scan implements the database/sql Scanner interface.
func ( *ACLItem) ( interface{}) error {
	if  == nil {
		* = ACLItem{Status: Null}
		return nil
	}

	switch src := .(type) {
	case string:
		return .DecodeText(nil, []byte())
	case []byte:
		 := make([]byte, len())
		copy(, )
		return .DecodeText(nil, )
	}

	return fmt.Errorf("cannot scan %T", )
}
Value implements the database/sql/driver Valuer interface.
func ( ACLItem) () (driver.Value, error) {
	switch .Status {
	case Present:
		return .String, nil
	case Null:
		return nil, nil
	default:
		return nil, errUndefined
	}