public interface MySqlParameter extends Disposable
Binding.
TODO: add ScalarParameter for better performance.
Disposable.Composite, Disposable.Swap| Modifier and Type | Method and Description |
|---|---|
default void |
dispose() |
MySqlType |
getType()
Get the
MySqlType of this parameter data. |
default boolean |
isNull()
Note: the
null is processed by built-in codecs. |
Publisher<io.netty.buffer.ByteBuf> |
publishBinary()
Binary protocol encoding.
|
Mono<Void> |
publishText(ParameterWriter writer)
Text protocol encoding.
|
isDisposeddefault boolean isNull()
null is processed by built-in codecs.true if it is null. Codec extensions should always return false.Publisher<io.netty.buffer.ByteBuf> publishBinary()
Note: not like the text protocol, it make a sense for state-less.
Binary protocol maybe need to add a var-integer length before encoded content. So if makes it like
Mono<Void> publishBinary (Xxx binaryWriter), and if supports multiple times writing like a
OutputStream or Writer for each parameter, this make a hell of a complex state system.
If we don't support multiple times writing, it will be hard to understand and maybe make a confuse to
user.
Mono<Void> publishText(ParameterWriter writer)
Note: not like the binary protocol, it make a sense for copy-less.
If it seems like Publisher<? extends CharSequence> publishText(), then we need to always deep
copy results (with escaping) into the string buffer of the synthesized SQL statement.
WARNING: the output requires state synchronization after this function called, so if external
writer buffered the writer, please flush the external buffer before receiving the completion
signal.
writer - the text protocol writer, extended Writer, not thread-safety.MySqlType getType()
MySqlType of this parameter data.
If don't want to support the binary protocol, just throw an exception please.
default void dispose()
dispose in interface DisposableCopyright © 2018–2023 asyncer.io. All rights reserved.