Skip to content

Feature/iterables #530

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

Merged
merged 1 commit into from
Mar 12, 2020
Merged

Feature/iterables #530

merged 1 commit into from
Mar 12, 2020

Conversation

parzhitsky
Copy link
Contributor

Description

This PR adds various iterables to the Record class:


Usage

The new functionality allows, among other things, getting values lazily, on-demand (which for example allows short-circuiting, if needed), and / or in pairs:

// prerequisite
const queryResult = await session.run(query);
for (const record of queryResult.records)
  for (const [ key, value ] of record.entries())
    // do something with 'key' and 'value'
for (const record of queryResult.records)
  for (const value of record)
    // each queried value is accessible as 'value'

@parzhitsky
Copy link
Contributor Author

Not sure how to fix build failures :(

@jharris4
Copy link
Contributor

I believe the build is failing because you have not signed the CLA.

Can you please follow the process described here: https://neo4j.com/developer/cla/

@parzhitsky
Copy link
Contributor Author

I did send the email though (today at 15:02 EET, receiver is cla@neotechnology.com). Perhaps, it has not propagate properly yet?

@parzhitsky
Copy link
Contributor Author

Oh, I forgot to attach PDF to the email, my bad.

@parzhitsky
Copy link
Contributor Author

Seems like it isn't related to CLA, since I've got a direct response from the CLA team with a confirmation just a couple of minutes ago.

I can't see any failure messages though, just the fact that the build has failed. No access to TeamCity as well. Could somebody help me with this?

@jharris4
Copy link
Contributor

@parzhitsky It seems that there was an email from the CLA team asking you to respond to an email with YES if you agreed to the terms. Can you check your email and I'll help more as soon as I can.

@parzhitsky
Copy link
Contributor Author

Thanks @jharris4! I did receive this email yesterday. I've responded with YES, and after that I've got a confirmation from Nina Chang (Feb 23 20:41 EET).

@jharris4
Copy link
Contributor

Ah ok, she's in California, so I will follow up with her later today to try and get this resolved.

Sorry for the delay!

@zhenlineo
Copy link
Contributor

Hi @parzhitsky, we have not received your CLA. Could you make sure that you followed the template suggested here? You need to also add the CLA pdf in your email.

Your changes look good. But could you squish all your commit into one commit with your PR description as commit message?

Cheers,
Zhen

@parzhitsky
Copy link
Contributor Author

could you squish all your commit

Are you sure? I mean, don't be mad, I'm happy to do that, but I took extra care to create flat history and atomic reversible commits; if squashed, per-commit reversibility will be lost.

we have not received your CLA […] make sure that you followed the template

Okay, I'll try it again, carefully. I'm sure, that I've followed the template though (it was basically copy-pasted).

@zhenlineo
Copy link
Contributor

Hi @parzhitsky,

Usually we have one commit per feature. A commit shall be a whole story, including the changes and tests etc.

My personal use of the commit is mainly to look in IDE to understand why a line was changed in a certain way. If the commit comes with a nice description like the one you have for this PR, then it will take me 1 mins to understand the change. Otherwise, It might takes me 10 mins or more following your working path to rebuild the whole story.

If we ever revert any changes, it is also easier to revert the whole feature in one go, rather than going into the history look each commit what shall be reverted and what not.

So be free to squash. Your PR description is very clear about the whole feature.

parzhitsky added a commit to parzhitsky/neo4j-javascript-driver that referenced this pull request Feb 26, 2020
@zhenlineo
Copy link
Contributor

Can you also put the PR description in the commit message directly? Thanks a lot.

@parzhitsky
Copy link
Contributor Author

Sure, sorry

This PR adds various iterables to the Record class: values(), entries(), [Symbol.iterator]().

The new functionality allows, among other things, getting values lazily, on-demand, and / or in pairs:

const queryResult = await session.run(query);

for (const record of queryResult.records)
  for (const [ key, value ] of record.entries())
    // do something with 'key' and 'value'

for (const record of queryResult.records)
  for (const value of record)
    // each queried value is accessible as 'value'
@parzhitsky
Copy link
Contributor Author

FYI, I've sent my CLA again a couple of days ago

@jharris4
Copy link
Contributor

jharris4 commented Mar 5, 2020

@parzhitsky Sorry for the delay, I've just added you to the whitelist.

The builds should pass the initial whitelist check for you from now on

@parzhitsky
Copy link
Contributor Author

@jharris4 Great news, thanks! Could you please also trigger the build for #532 as well?

@martin-neotech martin-neotech merged commit 27bac93 into neo4j:4.0 Mar 12, 2020
@parzhitsky parzhitsky deleted the feature/iterables branch May 20, 2020 13:45
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.

4 participants