John Liu Blog

Every drop counts

Snowflake notes

To grant access to a role grant usage on warehouse compute_wh to role mytestrole; grant usage on database test to role mytestrole; grant usage on schema study to role mytestrole; --select on individual table grant select on table test.study.sales to role mytestrole; --full access to all existing tables grant select,insert,update,delete on all tables in schema test.study to role mytestrole; --automatically grant access to future tables grant select on future tables in schema test.

QGIS get data from API

To retrieve data via API call in QGIS, we can utilise Python code to make the API call. Launch QGIS, open Plugins -> Python Console. In Python Console, click Show Editor icon to open editor. In editor window, make new script or open the Python script and execute the Python script. Following is an example Python script to make API call. ##If keyring is not installed, run the following in QGIS Python console to install keyring.

Azure SQL DB call external API

With the introducing of sp_invoke_external_rest_endpoint in Azure SQL DB, it’s possible to directly calling the Azure OpenAI service within the database. Azure OpenAI is in the safe-listed Azure services. For other API service (like common OpenAI) that’s not in the safe-list, you will need to create a wrapper API in the Azure API Management Instance. To invoke external rest endpoint in Azure SQL DB, a few setup steps are required: