Git Product home page Git Product logo

Comments (6)

G4brym avatar G4brym commented on May 23, 2024 1

Hey @aperture147
I've just added support for join clauses in the latest v0.1.3 version
You can read the docs here

Let me know if you have any more suggestion

from workers-qb.

G4brym avatar G4brym commented on May 23, 2024 1

Hey @aperture147 I've just added support for multiple joins, checkout the docs here
https://workers-qb.massadas.com/advanced-queries/join/#multiple-joins

from workers-qb.

G4brym avatar G4brym commented on May 23, 2024

Hey @aperture147 I will be looking into adding support for this next week
Thanks for suggesting this 😄

from workers-qb.

subhendukundu avatar subhendukundu commented on May 23, 2024

fields: ['role', 'department', 'payroll.salary'], returning the data in the same level of the object. Would it possible to have the salary key in the payroll object?

from workers-qb.

aperture147 avatar aperture147 commented on May 23, 2024

Thanks for your support! Is there any way to perform joining on multiple table? We can change

_join(value?: Join): string {
from accepting a single Join object to an array of Join? Eg:

  _join(values?: Array<Join>): string {
    if (!values || !values.length) return ''
    let joinQuery = ''
    values.forEach((item: Join) => {
        const type = value.type ? ` ${value.type}` : ''
        joinQuery += `${type} JOIN ${value.table} ON ${value.on}`
    })

    return joinQuery
  }

This is a rough implementation to show the idea, sorry if it does not work.

from workers-qb.

G4brym avatar G4brym commented on May 23, 2024

Hey @subhendukundu that kind of result transformation should be handled in your application, workers-qb is only meant to generate sql queries

from workers-qb.

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.