Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Join class does not support joining tables by non-id fields #803

Open
DarkSide666 opened this issue Dec 10, 2020 · 2 comments
Open

Join class does not support joining tables by non-id fields #803

DarkSide666 opened this issue Dec 10, 2020 · 2 comments

Comments

@DarkSide666
Copy link
Member

DarkSide666 commented Dec 10, 2020

Currently we do not support joining tables by non-id fields because we don't know how to save records in such case.

See #802 and "Joining tables on non-id fields is not implemented yet" exception in Join class.

@mvorisek mvorisek changed the title Join class do not support joining tables by non-id fields Join class does not support joining tables by non-id fields Oct 14, 2021
@mvorisek
Copy link
Member

mvorisek commented Jul 7, 2022

here is a repro code:

$this->expectException(Exception::class); // TODO not implemented yet, see https://github.com/atk4/data/issues/803
$j = $m->join('contact4.foo_id', ['master_field' => 'test_id', 'reverse' => true]);
// $this->assertTrue($this->getProtected($j, 'reverse'));
// $this->assertSame('test_id', $this->getProtected($j, 'master_field'));
// $this->assertSame('foo_id', $this->getProtected($j, 'foreign_field'));

@mvorisek
Copy link
Member

mvorisek commented Feb 13, 2023

Currently there are these problems:

  • Join::reverse = true with join on non-ID field is not supported (Joining tables on non-id fields is not implemented yet exception is thrown)
  • foreign ID field type is hardcoded to integer
  • join ID field type is hardcoded to integer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants