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

Improve type flow #89

Merged
merged 2 commits into from
Apr 22, 2024
Merged

Improve type flow #89

merged 2 commits into from
Apr 22, 2024

Conversation

oyvindberg
Copy link
Owner

@oyvindberg oyvindberg commented Apr 22, 2024

  • Prefer from other tables instead of from self
  • Add some recursion between inference of column types within a table, to support a table with a foreign key on its own pk

example:

create table flaff
(
    code            short_text  not null,
    another_code    varchar(20) not null,
    some_number     integer     not null,
    specifier       short_text  not null,
    parentSpecifier short_text,
    constraint flaff_pk primary key (code, another_code, some_number, specifier),
    constraint flaff_parent_fk foreign key (code, another_code, some_number, parentSpecifier) references flaff
);
case class FlaffRow(
  /** Points to [[FlaffRow.code]] */
  code: ShortText,
  /** Points to [[FlaffRow.anotherCode]] */
  anotherCode: /* max 20 chars */ String,
  /** Points to [[FlaffRow.someNumber]] */
  someNumber: Int,
  specifier: ShortText,
  /** Points to [[FlaffRow.specifier]] */
  parentspecifier: Option[ShortText]
){
   val compositeId: FlaffId = FlaffId(code, anotherCode, someNumber, specifier)
 }

- Prefer from other tables instead of from self
- Add some recursion between inference of column types within a table, to support a table with a foreign key on its own pk
@oyvindberg oyvindberg merged commit 88cb366 into main Apr 22, 2024
9 checks passed
@oyvindberg oyvindberg deleted the improve-type-flow branch April 22, 2024 17:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant