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.

Let optional foreign key generator produce outer join

See original GitHub issue
  type ID = Array[Byte] // Oracle RAW
  object Users extends Table[User]("TB_USER") {
    def id = column[ID]("ID",O.PrimaryKey)
    def agencyId = column[Option[ID]]("AGENCY_ID")
    def inactive = column[Boolean]("INACTIVE", O.Default(false))
    def disabled = column[Boolean]("IS_DISABLED", O.Default(true))
    def agency = foreignKey("FK_TB_USER_AGENCY_ID",agencyId,Agencies)(_.id.?)
  }
  object Agencies extends Table[Agency]("TB_AGENCY") {
    def id = column[ID]("ID",O.PrimaryKey)
    def dataOutOfDate = column[Boolean]("IS_DATA_OUT_OF_DATE")
  }
  val q = for {
    u <- Users
    s <- u.agency // agencyId is Option[ID]; let this produce an outer join
  } yield (u.disabled, u.inactive, s.dataOutOfDate.?.getOrElse(false))

Issue Analytics

  • State:open
  • Created 10 years ago
  • Reactions:12
  • Comments:22 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Ossipcommented, Jan 11, 2017

+1 hi guys, I guess no update here?

2reactions
cvogtcommented, Sep 7, 2016

@trevorsibanda if you ever feel the itch for hacking on something, here is something that may fall into your ballpark 😉

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hibernate/JPA: ManyToOne to behave as LEFT OUTER JOIN ...
I have tried optional=true and nullable = true but it didn't help. My understanding is @JoinColumn is creating a Foreign Key relationship.
Read more >
16715 (Wrong JOIN with nested null-able foreign keys)
I assume this is a bug in how Django selects whether to use a LEFT JOIN vs. an INNER JOIN in foreign key...
Read more >
SQL OUTER JOINs: An overview of all types - IONOS
An SQL JOIN is a query operation that links several tables in a relational database and outputs their data records (tuples) filtered ...
Read more >
SQL FOREIGN KEY - W3Schools
The following SQL creates a FOREIGN KEY on the "PersonID" column when the "Orders" table is created: MySQL: CREATE TABLE Orders ( OrderID...
Read more >
SQL OUTER JOIN overview and examples
If there are any unmatched rows, it shows NULL values for them. We can understand efficiently using examples. Let's create a sample table...
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