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

feat: composite primary key #565

Merged
merged 2 commits into from
Jul 4, 2020

Conversation

Darkein
Copy link

@Darkein Darkein commented Jul 3, 2020

fix #164
add the possibility to have multiple primary keys.

exemple:

@Crud({
  ...
  params: {
    ...
    companyId: {
      field: 'companyId',
      type: 'number',
      primary: true
    },
    userId: {
      field: 'userId',
      type: 'number',
      primary: true
    },
  },
  ...
})
@Controller("teams")
export class TeamController {
  constructor(public service: TeamsService) {}
}

allow a team to be acceded from teams/{companyId}/{userId}

@michaelyali michaelyali merged commit 644acfd into nestjsx:master Jul 4, 2020
@Bnaya
Copy link

Bnaya commented Jul 4, 2020

Thanks :)

@Darkein Darkein deleted the feature/multiPrimaryKeys branch July 6, 2020 08:31
@patrickmichalina
Copy link

Has this code been removed? It no longer works.

@patrickmichalina
Copy link

Oh this hasn't been released?

@tbrannam
Copy link
Contributor

I've been waiting for this to be released as well.

@sirmuzz
Copy link

sirmuzz commented Aug 5, 2022

me too

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.

Question: How to handle tables with composite primary key
6 participants