Coder Social home page Coder Social logo

gosql's People

Contributors

quintans avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gosql's Issues

wrong join clause for association

Following your example, I try joining book with both publisher and book_bin associations:

store.Query(BOOK).
    All().
    Inner(BOOK_A_PUBLISHER).
    Inner(BOOK_A_BOOK_BIN).
    Fetch().
    Where(BOOK_C_ID.Matches(1)).
    SelectTree(&book)

There is a book in my DB, but it doesn't return any result. From the debug log,

SELECT t0.`PUBLISHER_ID` AS t0_PublisherId,
    t0.`ID` AS t0_Id, t0.`VERSION` AS t0_Version,
    t0.`NAME` AS t0_Name, t0.`PRICE` AS t0_Price,
    t0.`PUBLISHED` AS t0_Published, t0_j1.`ID` AS t0_j1_Id,
    t0_j1.`VERSION` AS t0_j1_Version, t0_j1.`NAME` AS t0_j1_Name,
    t0_j2.`ID` AS t0_j2_Id, t0_j2.`VERSION` AS t0_j2_Version,
    t0_j2.`HARDCOVER` AS t0_j2_Hardcover
FROM `BOOK` t0 INNER JOIN `PUBLISHER` t0_j1 ON t0.`PUBLISHER_ID` = t0_j1.`ID`
    INNER JOIN `BOOK_BIN` t0_j2 ON t0_j1.`ID` = t0_j2.`ID`
WHERE t0.`ID` = :t0_R1

The join clause for BOOK_BIN is wrong. It should be corrected to
ON t0.ID = t0_j2.ID

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.