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

Questions: Composite data types and foreign keys #347

Closed
flying-sheep opened this Issue May 27, 2016 · 1 comment

Comments

Projects
None yet
2 participants
@flying-sheep

flying-sheep commented May 27, 2016

Hi, I’m confused how things play together.

I have a Record struct with some fields and want to insert those fields’ values into an assigned_records table together with to some group key.

is it possible to do this or do i need to create a relation table:

CREATE TABLE assigned_records (
    id INTEGER PRIMARY KEY,
    record_id INTEGER REFERENCES records (id),
    group_id INTEGER REFERENCES groups (id)
)

How do foreign keys in general work? do i get their relations represented in rust somehow or are they simply u32 fields and can be used in joins?

@sgrif

This comment has been minimized.

Member

sgrif commented May 29, 2016

They're simply i32 fields, treated like any other field. We don't take indexes into account.

@sgrif sgrif closed this May 29, 2016

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