Skip to content
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

Merged
merged 2 commits into from
Apr 23, 2021
Merged

Conversation

loyd
Copy link
Collaborator

@loyd loyd commented Apr 12, 2021

No description provided.


#[inline]
fn write(&self, mut dst: impl fmt::Write) -> fmt::Result {
write!(&mut dst, "[")?;
Copy link
Collaborator Author

@loyd loyd Apr 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@quasiyoke

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@quasiyoke quasiyoke force-pushed the master branch 4 times, most recently from 07aa88a to 7af242a Compare April 16, 2021 19:07
@@ -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,
Copy link
Collaborator Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

#[allow(dead_code)]
impl<'a, T: Bind> Sealed for &'a [T] {}

const EMPTY_LIST_SQL: &str = "(NULL)";
Copy link
Collaborator Author

@loyd loyd Apr 17, 2021

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@loyd loyd merged commit c3556e3 into ClickHouse:master Apr 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants