Image for post
Image for post
Sabre Clock ®

Hope you're all fine during this health crisis. Remember to keep safe and if possible stay at home.

Have you ever needed to give "some" access to your database, let's say SELECT access over certain tables, but also record what queries does the user execute?
We had this requirement a while ago. The first two parts are easy to achieve:

  1. Some access: Create a new use role while only select privileges.
  2. Access to some tables: Create a view over the required tables

Recording the executed queries is not that simple because there are no triggers over a SELECT query.

The dirty trick

So we need to record what queries are executed. We may need a new table, perhaps on another schema, and a Postgres function to insert a record on the log table. …


Why you shouldn’t use status 200 for nearly everything

Image for post
Image for post
Source: https://www.youtube.com/watch?v=LtNSd_4txVc

This is a conversation I’ve had many times, and it usually ends up in an argue because it’s highly opinionated.

The use case

Let’s say you have an API running on some web server, doesn’t matter which one. There’s a login endpoint and some other resources that can’t be accesible unless you have already logged in into the web application. To request any of these resources you enter some credentials, user and password, and the login is denied.

What status code should the server return?

  • 200 The request is successful as the endpoint does exist and makes some internal validation, but the response has to include some information on why the access is denied. …

and how to overcome them

Image for post
Image for post
Image borrowed from https://codefresh.io/continuous-integration/using-codefresh-with-mono-repos/ (the best one I found to graphically explain monorepos)

A few months ago, our CTO came back from his vacations and told us he assisted to NG Conf 2019. A great experience that lead him to this conclusion:

"We should develop as Google, using a monorepo"

(curiously this is very similar to NWRL.io's slogan).

At first, as a senior developer, this didn't make too much sense. …

About

Jose I Santa Cruz G

Polyglot senior software engineer at QuePlan.cl , amateur guitar & bass player, geek, husband. Not precisely in that order.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store