def pg_connect_bits(meta):
    """Turn the url into connection bits."""
    bits = []
    if meta['username']:
        bits.extend(['-U', meta['username']])
    if meta['hostname']:
        bits.extend(['-h', meta['hostname']])
    if meta['port']:
        bits.extend(['-p', str(meta['port'])])
    return bits
