Giter Club home page Giter Club logo

Comments (6)

coffeemug avatar coffeemug commented on July 20, 2024

Moving to backlog until more pressing issues are worked out.

from rethinkdb.

neumino avatar neumino commented on July 20, 2024

This query fails:

r.db('w').table('design').eqJoin('id', r.db('w').table('user'), 'id_user').zip().run()

The primary key of the table design is "id" and the one of the table user is "id_user".

I get this error:

Runtime Error: Attribute: id is not the primary key (id_user) and thus cannot be selected upon.
    r.db('w').table('design').concatMap(function(arg0_10) {return r.let({'right':r.db('w').table('user').get(r.letVar('arg0_10')('id'), 'id')}, r.branch(r.letVar('right').ne(r.expr(null)), r.expr([r.expr({'left':r.letVar('arg0_10'), 'right':r.letVar('right')})]), r.expr([])))}).map(function(arg0_11) {return r.branch(r.letVar('arg0_11').contains(right), r.letVar('arg0_11')('left').merge(r.letVar('arg0_11')('right')), r.letVar('arg0_11')('left'))})

So the problem is not just that the default key is "id" but that the default key is always "id" even if the user define the primary key.

from rethinkdb.

coffeemug avatar coffeemug commented on July 20, 2024

That seems to be a bug in the driver. @wmrowan -- could you take a look?

EDIT: this is a separate issue from the original one, so @wmrowan -- perhaps you should open a new one that we fix now.

from rethinkdb.

wmrowan avatar wmrowan commented on July 20, 2024

In regards to the original issue described here, I'd be in favor of merging this into the protocol refactoring process since this is an already acknowledged goal of that effort. In the future, these optional attributes will be included as optargs on their respective operations in the protocol spec and the server will use the known primary key for the table if the optarg is not provided. Given this, I see little reason to fix this now.

from rethinkdb.

wmrowan avatar wmrowan commented on July 20, 2024

Meant to close the other one

from rethinkdb.

coffeemug avatar coffeemug commented on July 20, 2024

This is no longer relevant, closing.

from rethinkdb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.