-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: support for bool
and IN clause
#9
Conversation
|
||
#[inline] | ||
fn write(&self, mut dst: impl fmt::Write) -> fmt::Result { | ||
write!(&mut dst, "[")?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suppose it's done in order to support empty lists, innit?
JFYI: It's also possible to use tuples here and pass (NULL)
for empty lists.
It relies on the property that NULL
cannot be checked using equality/IN, so it's safe for Nullable
. On the other hand, it's valid syntax, because of the type propagation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
07aa88a
to
7af242a
Compare
src/rowbinary/tests.rs
Outdated
@@ -100,6 +102,8 @@ fn sample_serialized() -> Vec<u8> { | |||
0x42, 0x54, 0x43, 0x00, /**/ | |||
// [Array(Int32)] [-42, 42, -42, 42] | |||
0x04, 0xd6, 0x2a, 0xd6, 0x2a, /**/ | |||
// [Boolean] true | |||
0x01, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, add /**/
before the newline to avoid joining by rustfmt when a new field is added
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src/sql_builder/mod.rs
Outdated
#[allow(dead_code)] | ||
impl<'a, T: Bind> Sealed for &'a [T] {} | ||
|
||
const EMPTY_LIST_SQL: &str = "(NULL)"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't we decide to use arrays instead, as you had suggested?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
No description provided.