question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Using andOn inside innerJoinTableOnFunction not translated column according to definition

See original GitHub issue

Issue type:

[X ] Question [ X] Bug report [ ] Feature request [ ] Documentation issue

Database system/driver:

[X ] Postgres [ ] MSSQL [ ] MySQL [ ] MariaDB [ ] SQLite3 [ ] Oracle [ ] Amazon Redshift

typed-knex version:

[ X] latest [ ] @next [ ] 0.x.x (or put your version here)

Knex.js version: 0.95.12

Query:

   .innerJoinTableOnFunction("sector", RecordTable, (join) => {
        join.andOnVal("group", "=", "MASTER_DATA")
            .andOnVal("key", "=", "SECTOR")
            .andOn("subKey", "=", "budget.sector");
    })

Table Definition:

@Table("records")
export class RecordTable {
    @Column({ primary: true, name: "id" })
    public id!: string;

    @Column({ name: "group" })
    public group!: string;

    @Column({ name: "key" })
    public key!: string;

    @Column({ name: "sub_key" })
    public subKey!: string;

    @Column({ name: "data" })
    public data!: string;
}

The subKey column is suppose to translate into "sector"."sub_key"

Now is generating something like this

INNER JOIN "records" AS "sector" ON "sector"."group" = $1
		AND "sector"."key" = $2
		AND "budget"."sector" = "sector"."subKey"

Postgres error hint:

 hint: 'Perhaps you meant to reference the column "sector.sub_key".',

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wwwoutercommented, Jan 12, 2022

Something went wrong when publishing. v4.5.1 should work

0reactions
ucincommented, Jan 12, 2022

Hi @wwwouter,

I follow your instruction and my code work without any modification! It turn out my local typed-knex is not being updated even the version is already the latest. I’m not sure if the issue is with lerna or npm.

Thanks again for your assistance! I really enjoy working with typed-knex!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Andon: How the System Works with Examples | SafetyCulture
Andon is a visual management system used by operators and managers in lean manufacturing to easily determine and display the status of ...
Read more >
A Guide to Andon in Lean Manufacturing | Lucidchart Blog
What is Andon? The Jikoda methodology empowers operators to make decisions in manufacturing without having to wait for managerial approval. The Andon system ......
Read more >
How to use a Andon – and how not to | AllAboutLean.com
In my previous post I described how the mechanical side of an andon works. In this post I tell you how the workers...
Read more >
What is Andon in Lean Manufacturing? - Planview
This means giving operators not only the permission, but the obligation to stop the line when issues arise. Employees, especially in manufacturing, are...
Read more >
Ultimate Guide to Andon Systems - Shop Floor IQ
A component of Lean Manufacturing, an Andon system is a communication scheme used to signal workers in manufacturing that there is a problem...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found