Skip to content

Support relationships based on built-in functions (i.e. st_within) #10686

Open
@olmohake

Description

@olmohake

Component

v/3-engine
v/3-ndc-postgres

Is your proposal related to a problem?

We manage a large number of tables with entries related through geometry columns instead of foreign keys. For instance, a table of buildings with geometries and tables like districts or housing zones with corresponding geometries. Given the frequent changes in zoning and the high number of relationships, calculating and storing foreign keys is impractical.

Describe the solution you'd like

It would be useful to define relationships via built-in functions like ST_Within instead of just foreign key mapping.

kind: Relationship
version: v1
definition:
  name: buildings
  sourceType: District
  target:
    model:
      name: Buildings
      relationshipType: Array
  mapping:
    - function:
         functionName: st_within
         arguments:
             - target:
                 fieldPath:
                    - fieldName: geometry
             - source:
                 fieldPath:
                    - fieldName: geometry

Describe alternatives you've considered

Creating native operations and mapping them to commands, but this approach is impractical due to the large number of operations required just to enable data joins.

Metadata

Metadata

Assignees

No one assigned

    Labels

    c/v3-engineV3 Metadata and Enginec/v3-ndc-postgresData connector for PostgreSQLk/enhancementNew feature or improve an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions