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

New upsert block #3412

Merged
merged 7 commits into from
Jun 20, 2019
Merged

New upsert block #3412

merged 7 commits into from
Jun 20, 2019

Conversation

mangalaman93
Copy link
Contributor

@mangalaman93 mangalaman93 commented May 14, 2019

Related to #3197
Fixes #3059

Example upsert operation -

   upsert {
      query {
        me(func: eq(email, "[email protected]")) {
          v as uid
        }
      }
      mutation {
          set {
            uid(v) <name> "Aman" .
            uid(v) <email> "[email protected]" .
          }
      }
    }

Probably in the next version -

  • Add support for multi valued variables
  • Support for val function
  • Add support for @if
  • Fuzz tests

Changes in other repos -

Todo

  • Add lots of tests for RDF and JSON
  • Add documentation (docs.dgraph.io)
  • Add support for tracing
  • JSON format for upsert block
  • Add V(3) logging
  • Support for uid function
  • Fragments in upsert block
  • Two query blocks inside upsert block?
  • no query block inside upsert block?
  • no mutation block inside upsert block?
  • no variable in query block?
  • support for blank nodes in mutation block?
  • Ensure upsert only generates 1 UID

This change is Reviewable

gql/state.go Outdated Show resolved Hide resolved
gql/state.go Outdated Show resolved Hide resolved
@mangalaman93 mangalaman93 force-pushed the aman/upsert branch 2 times, most recently from 45726c5 to 378caa0 Compare May 20, 2019 16:55
gql/parser_mutation.go Outdated Show resolved Hide resolved
@mangalaman93 mangalaman93 changed the title [WIP] New Transaction API [WIP] New mutation using txn block May 21, 2019
gql/state.go Outdated Show resolved Hide resolved
gql/state.go Outdated Show resolved Hide resolved
@mangalaman93 mangalaman93 force-pushed the aman/upsert branch 3 times, most recently from d936cba to 1ebe573 Compare May 22, 2019 10:50
@mangalaman93 mangalaman93 force-pushed the aman/upsert branch 2 times, most recently from 71f1110 to 62afd15 Compare May 30, 2019 13:10
gql/state.go Outdated Show resolved Hide resolved
gql/state.go Outdated Show resolved Hide resolved
gql/state.go Outdated Show resolved Hide resolved
@mangalaman93 mangalaman93 force-pushed the aman/upsert branch 3 times, most recently from c3a0744 to d4e5dde Compare May 31, 2019 07:06
@mangalaman93 mangalaman93 changed the base branch from master to aman/acl_refactor May 31, 2019 07:06
edgraph/server.go Outdated Show resolved Hide resolved
@mangalaman93 mangalaman93 changed the title [WIP] New mutation using txn block [WIP] New upsert block May 31, 2019
@mangalaman93 mangalaman93 reopened this Jun 1, 2019
@mangalaman93 mangalaman93 changed the base branch from aman/acl_refactor to master June 1, 2019 13:53
@mangalaman93 mangalaman93 force-pushed the aman/upsert branch 2 times, most recently from a5d813c to 4fe3ff1 Compare June 3, 2019 16:19
Copy link
Contributor

@MichaelJCompton MichaelJCompton left a comment

Choose a reason for hiding this comment

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

OK

I'll talk to others here this week to understand my problem - looks like everyone else is ok with it.

Reviewable status: 12 of 15 files reviewed, 35 unresolved discussions (waiting on @danielmai, @gitlw, @golangcibot, @manishrjain, and @martinmr)

Copy link
Contributor

@MichaelJCompton MichaelJCompton left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewable status: 12 of 15 files reviewed, 35 unresolved discussions (waiting on @danielmai, @gitlw, @golangcibot, @manishrjain, and @martinmr)

@mangalaman93 mangalaman93 merged commit 3eff1b2 into master Jun 20, 2019
@mangalaman93 mangalaman93 deleted the aman/upsert branch June 20, 2019 07:30
mangalaman93 added a commit that referenced this pull request Jun 20, 2019
Following are now possible (useful in upsert API)
  * uid(v) <predicate> "object" .
  * <0x01> <predicate> uid(foo) .

For now, we only support uid function. In future, we can
add support for more functions.
mangalaman93 added a commit that referenced this pull request Jun 20, 2019
mangalaman93 added a commit that referenced this pull request Jun 20, 2019
@manishrjain
Copy link
Contributor

@MichaelJCompton : I can answer that question.

@ashim-kr-saha ashim-kr-saha mentioned this pull request Jul 5, 2019
14 tasks
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
Following are now possible (useful in upsert API)
  * uid(v) <predicate> "object" .
  * <0x01> <predicate> uid(foo) .

For now, we only support uid function. In future, we can
add support for more functions.
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
dna2github pushed a commit to dna2fork/dgraph that referenced this pull request Jul 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Support a new Upsert operation
6 participants