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

investigate: auto querying primary key to simplify assemble #1

Open
nicoabie opened this issue Oct 23, 2023 · 0 comments
Open

investigate: auto querying primary key to simplify assemble #1

nicoabie opened this issue Oct 23, 2023 · 0 comments

Comments

@nicoabie
Copy link
Contributor

In V1 of ojotas it is needed that the user specifies for each query where relations are being included which key is going to serve as the unique identifier of each object. This is important for deduping purposes

ie:

select j.jobNumber, jl.locationId, jl.dispatcherNotes from job j inner join job_location jl on j.jobId = jl.jobId;

We need to tell ojotas (manually) that jobNumber and locationId are the unique identifiers of those entities.

Another possibility would be that ojotas always include in the sql query the primary key of each object. Use that to do the assemble and then discard it so the user only gets what they asked for. Sequelize does this behind the scenes too to have better DX when manually specifying attributes.

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

No branches or pull requests

1 participant