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

Initial support for joining relations and filtering on joined relations. #147

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

rmallah
Copy link
Contributor

@rmallah rmallah commented May 30, 2023

support for joins have been implemented in list method. This will
allow fetching of related records by specifying in 'join' parameters.
currently joining with immediate relations is only supported.

redgrapetech and others added 5 commits May 29, 2023 10:25
…on#124

currently read_schema returns the default values of db in verbatim
even if they are function calls. This causes attempts to insert
the function call body as defaults in columns instead of the
the value, which does not makes sense. The current fix returns undef
for such column defaults. Additionally as a measure of caution it
does not do the above in case the default has been handled in
fix_default mapping.
ignoring column defaults of db which are function calls issue preaction#124
currently uuid columns are typed as string with no
particular format. However uuid strings stored in
uuid data types in databases does not support the
like operator. It is better to use '=' operator for
the uuid columns for a functional match.
support for uuid data type column in search
support for joins have been implemented in list method. This will
allow fetching of related records by specifying in 'join' parameters.
currently joining with immediate relations is only supported.
@rmallah rmallah changed the title Intial support for joining relations and filtering on joined relations. Initial support for joining relations and filtering on joined relations. May 30, 2023
@rmallah
Copy link
Contributor Author

rmallah commented May 30, 2023

this shall be re-submitted.

@rmallah rmallah closed this May 30, 2023
@rmallah rmallah reopened this Jun 1, 2023
support for specifying complex joins via query parameter is being
introduced. The json is encoded as per uri encoding scheme and is
decoded into a perl reference. The same reference is passed as the
'join' parameter in DBIC. This allows the same familier
syntax to be adopted for specifying the joins.

How it works:
* The data structure in join is passed to a function _get_unique_relationships
to get all the unique relations as keys of a hash. for each of such relation
the properties are determined and are stored in another hash having keys
in the format 'relation_name.key_name' , the value being the properties of
the column. these properties help in using the appropriate operators at sql
level. Note that it is also possible to filter the results based on any of
the relationship columns by specifying as relation.columnname=somevalue in
query parameters.
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.

2 participants