2022-12-26

Author: Meet

Worked with data a lot for today, fetched some metrics realted to a deployed app on azure like api calls, db connections, queries and active user count. In that process, worked with azure portal created and learned about queries to be performed on the platform for fetching metrics, newrelic NRQL queries and dashboard first time interaction. Also did a litle sql and django query building for those metrics(db connections).

TIL

Dug a bit deep and learnt afresh about UDFs in SQL, understood the four components: name, arguments, return and function body. The actual content that can be returned is a sql query string.

/* create a udf add */
CREATE FUNCTION add(a INT, b INT) RETURNS INT AS 'SELECT a+b, a-b' LANGUAGE SQL

SELECT * FROM add(2, 3)

It returns a single int as defined in the function signature.