Page 1 of 1

1:1 relationship support

Posted: 2022-12-11 21:39
by grimblefritz
Ahmed indicated back in 2019 that 1:1 support was coming soon.

Any update as to when soon will arrive?

Re: 1:1 relationship support

Posted: 2022-12-11 21:46
by jsetzer
do you mean n:m instead of 1:1?

Re: 1:1 relationship support

Posted: 2022-12-12 14:27
by grimblefritz
Sure, if n=1 and m=1

Re: 1:1 relationship support

Posted: 2022-12-12 14:32
by grimblefritz
The thread I was referencing viewtopic.php?f=11&t=3100

Re: 1:1 relationship support

Posted: 2022-12-12 15:00
by jsetzer
Thanks for the link. Now we know what you were referring to.

Re: 1:1 relationship support

Posted: 2022-12-12 15:10
by jsetzer
grimblefritz wrote:
2022-12-11 21:39
Ahmed indicated back in 2019 that 1:1 support was coming soon.

Any update as to when soon will arrive?
Wouldn't it be easiest to deny insert into Table B if there is an existing record, already? Could be done in standard.

For example:
1) Revoke Insert permission for Table B.
2) on after insert into Table A, auto-create a record in Table B, using the primary key of (the new) Table A record.

This should do it on database side.

Now in UI you may want to get rid of the default children tab. This can be done in AppGini model. Instead, you may want to embed Table B's Detail View into Table A's Detail View, or you need a button in Table A's Detail View, opening Table B's Detail view. Primary key in Table B should be identical with $selectedID in this scenario.

Re: 1:1 relationship support

Posted: 2022-12-13 18:32
by grimblefritz
That's more or less where I've been heading:

1) sibling pk == primary pk (and is of course unique)

2) insert the sibling record (records, as there are in reality a dozen sibling tables) when the primary record is created

3) add links or buttons to the primary detail view to open the sibling detail views

That's the view from the moon. I'm sure it will be more involved than that.