207 likes
路
3.0K reads
6 comments
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
Nice article!!
Great article馃挴
Interesting 馃憦
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.
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.