'Provide a bound value processing function for the
given :class:`.Dialect`.
This is the method that fulfills the :class:`.TypeEngine`
contract for bound value conversion.   :class:`.TypeDecorator`
will wrap a user-defined implementation of
:meth:`process_bind_param` here.
User-defined code can override this method directly,
though its likely best to use :meth:`process_bind_param` so that
the processing provided by ``self.impl`` is maintained.
:param dialect: Dialect instance in use.
This method is the reverse counterpart to the
:meth:`result_processor` method of this class.'

def bind_processor(self, dialect):

    if self._has_bind_processor:
        process_param = self.process_bind_param
        impl_processor = self.impl.bind_processor(dialect)
        if impl_processor:
            def process(value):
                return impl_processor(process_param(value, dialect))
        else:
            def process(value):
                return process_param(value, dialect)
        return process
    else:
        return self.impl.bind_processor(dialect)
