Skip to content

[FEATURE] Support ~~UPSERT~~ REPLACE in sqlVerbs and in front end grammar #97

Description

@jeffreyaven

Feature Description
support
UPSERT REPLACE as an alias to UPDATE, helps to differentiate put and patch methods with the same signatures

Example(s)

for the following DML operation:

UPSERT INTO google.compute.firewalls
SET field1 = 'value1'
WHERE project = 'my-project'
AND firewall = 'my-firewall'

would use this resource definition...

    firewalls:
      id: google.compute.firewalls
      name: firewalls
      title: Firewalls
      methods:
...
        update:
          operation:
            $ref: '#/paths/~1projects~1{project}~1global~1firewalls~1{firewall}/put'
          response:
            mediaType: application/json
            openAPIDocKey: '200'
        patch:
          operation:
            $ref: '#/paths/~1projects~1{project}~1global~1firewalls~1{firewall}/patch'
          response:
            mediaType: application/json
            openAPIDocKey: '200'
      sqlVerbs:
...
        upsert:
          - $ref: '#/components/x-stackQL-resources/firewalls/methods/update'
        update:
          - $ref: '#/components/x-stackQL-resources/firewalls/methods/patch'
...

to access the upsert route, treated the same as and update but routed to the proper operation in the path

Activity

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

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions