Sign in
Log inSign up
Nicolas Fr盲nkel

207 likes

2.8K reads

6 comments

Vladimir Kolev
Vladimir Kolev
Nov 24, 2022

Great article! I had my look on APISIX for some time and didn't know about PostgREST. Btw. perhaps your could revisit your Dockerfile and add the apt-get layer after the FROM otherwise you will have to redownload the apt dependencies on every build for every change. Also WORKDIR will create the directory if it doesn't exist.

FROM debian:bookworm-slim                                                   #1

RUN apt-get update && \
    apt-get install -y libpq-dev xz-utils

ARG POSTGREST_VERSION=v10.1.1                                               #2
ARG POSTGREST_FILE=postgrest-$POSTGREST_VERSION-linux-static-x64.tar.xz     #2


WORKDIR postgrest

ADD github.com/PostgREST/postgrest/releases/do…$POSTGREST_VERSION/$POSTGREST_FILE \
    .                                                                       #3

RUN tar xvf $POSTGREST_FILE && \
    rm $POSTGREST_FILE                                                      #4
5
Paul Chibueze
Paul Chibueze
Nov 23, 2022

Nice article!!

1
Someshwar Tripathi
Someshwar Tripathi
Nov 24, 2022

Great article馃挴

1
Lucky victory
Lucky victory
Nov 24, 2022

Interesting 馃憦

1
Federico Kereki
Federico Kereki
Nov 25, 2022

This is an interesting idea, but having an API based on physical tables instead of logical entities is considered an antipattern. For instance here at it reads: A resource doesn't have to be based on a single physical data item. For example, an order resource might be implemented internally as several tables in a relational database, but presented to the client as a single entity. Avoid creating APIs that simply mirror the internal structure of a database. The purpose of REST is to model entities and the operations that an application can perform on those entities. A client should not be exposed to the internal implementation.

1 reply
Nicolas Fr盲nkel
Nicolas Fr盲nkel
Author
Nov 26, 2022

You're right... in theory. And then, as I mentioned, sometimes, you don't want to spend time and money implementing the perfect solution: you just want to see if there's traction and interested.