stackql / stackql/stackql-devel

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

Open
#97 0 comments 0 reactions 1 assignee View on GitHub

@general-kroll-4-life is already working on this.

Since Aug 23, 2024.

enhancement
Dominant language
Go
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.