[ReaAct] Lock via automatic JOIN queries
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 42/100
Research direction
Start by reading the BaseMigration JOIN example and compare it with the filter data structure and client autoupdate subscription data structure mentioned in the issue. Define how requested models, fields, relations, and update locking should be represented, then verify that the resulting query joins the required tables and locks the requested rows together.
Written by the indexing model from the issue text.
Description
- Specifying a dictionary of requested models and some of its fields and relations should automatically create a JOIN query.
- This should also specify if the models should be locked for update, having the advantage that models/rows are locked at once.
- filter data structure or client autoupdate subscription data structure might be an inspiration on how to do it
Example from BaseMigration:
join_on_parts: list[sql.Composable] = []
for table, join_on_columns in additional_source_tables.items():
join_on_parts.append(
get_join_table_part(table, join_on_columns)
)
join_on = sql.SQL(" ").join(join_on_parts)
def get_join_table_part(
right_table: Table, join_on_columns: dict[Field, tuple[Table, Field]]
) -> sql.Composable:
return sql.SQL(" JOIN {right_table} ON {columns}").format(
right_table=sql.Identifier(right_table),
columns=sql.SQL(" AND ").join(
sql.SQL(
"{right_table}.{right_column} = {left_table}.{left_column}"
).format(
right_table=sql.Identifier(right_table),
right_column=sql.Identifier(right_column),
left_table=sql.Identifier(left_table_and_column[0]),
left_column=sql.Identifier(left_table_and_column[1]),
)
for right_column, left_table_and_column in join_on_columns.items()
),
)
Example of additional_source_tables:
main_source_table = "vote_t"
additional_source_tables={
"meeting_user_t": {
"user_id": ("vote_t", "user_id"),
"meeting_id": ("vote_t", "meeting_id"),
},
"option_t": {"id": ("vote_t", "option_id")},
"poll_t": {"id": ("option_t", "poll_id")}
}
- Dominant language
- Python
- Stars
- 9
- Forks
- 41
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 48
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from OpenSlides/openslides-backend
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
OpenSlides/openslides-backend#3774 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OpenSlides/openslides-backend#3756 · 2 comments ·
Maintainers usually reply within 1 day
-
Consultation sequence: new settingPossibly taken @luisa-beerboom claimed this 19 days ago. Openfeature Lorentz
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
OpenSlides/openslides-backend#3704 · 5 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
OpenSlides/openslides-backend#3430 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 3/5 Half a day Newbie friendliness 58/100
OpenSlides/openslides-backend#3885 ·
Maintainers usually reply within 1 day
All issues in OpenSlides/openslides-backend
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Pantheon-Security/medusa#24 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
docs(notation): the ipa_to_arpa section does not name the tied and non-syllabic diphthong formsOpen
Difficulty 1/5 Under an hour Newbie friendliness 88/100
TigreGotico/scriptconv#445 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
TigreGotico/phoonnx#1045 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 2 days