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

[feature] Utilize PostgREST for REST API #2314

Open
pxp928 opened this issue Nov 25, 2024 · 1 comment
Open

[feature] Utilize PostgREST for REST API #2314

pxp928 opened this issue Nov 25, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@pxp928
Copy link
Collaborator

pxp928 commented Nov 25, 2024

Is your feature request related to a problem? Please describe.

PostgREST should give us the ability to create a REST API on top of the postgres. Need to investigate if this works for us and if its worth using.

@pxp928 pxp928 added the enhancement New feature or request label Nov 25, 2024
@BWhitfield
Copy link

BWhitfield commented Nov 26, 2024

main...BWhitfield:guac:postgrest

Examples

PSQL

SELECT * FROM package_names
WHERE type = 'alpine'
LIMIT 5
OFFSET 5
id type namespace name
a3eddff2-4c32-53c6-9adc-0702a804b2a7 alpine ca-certificates-bundle
819cdb9d-3fc2-504d-a351-1bcad092d69a alpine zlib
a9e88158-8445-5c3f-998c-868dd5da010b alpine libc-utils
befec236-f7b9-51bf-adab-0a8ecf54c473 alpine apk-tools
370e957a-6396-5082-9e06-279bc7cf5675 alpine libssl1.1

PostgREST api call

http://localhost:3000/package_names?type=eq.alpine&offset=5&limit=5
[
  {
    "id": "a3eddff2-4c32-53c6-9adc-0702a804b2a7",
    "type": "alpine",
    "namespace": "",
    "name": "ca-certificates-bundle"
  },
  {
    "id": "819cdb9d-3fc2-504d-a351-1bcad092d69a",
    "type": "alpine",
    "namespace": "",
    "name": "zlib"
  },
  {
    "id": "a9e88158-8445-5c3f-998c-868dd5da010b",
    "type": "alpine",
    "namespace": "",
    "name": "libc-utils"
  },
  {
    "id": "befec236-f7b9-51bf-adab-0a8ecf54c473",
    "type": "alpine",
    "namespace": "",
    "name": "apk-tools"
  },
  {
    "id": "370e957a-6396-5082-9e06-279bc7cf5675",
    "type": "alpine",
    "namespace": "",
    "name": "libssl1.1"
  }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants