Enhancing Text-to-SQL With Synthetic Summaries

LLMs are being experimented with to do so many things today, and one of the use cases that sound compelling is getting their help to generate insights from data. What if you could find the answer to your data question without begging a data analyst in your company? But this is easier said than done. To perform this task properly, LLMs need to know about your datasets, the tables, their schemas, and values stored in them. You can provide this information in the prompt itself if your dataset is tiny, but this is not possible in most real life scenarios, since the information will be huge and either it won’t fit the LLM’s context knowledge or it will be very expensive and not feasible. ...

2025-03-18 · 2 min

Adding new entries to a Supabase postgres table via REST API

I read this blog post from Jordan on how he created a simple feature request form on his iOS app using Supabase’s Swift library. I wanted to try this out on Python to see how easy would be to implement this when I need a quick way to add a form functionality in a backend service. Here is what I did: Created a free Supabase account . Created a new project. Created a new table in the project and called it feature_request, and added a new column called text. Grabbed the unique API URL and API Key from Project Settings > API. Made an API call in Python: import requests supabase_url = "https://ufcgesssclkrciknuaey.supabase.co" table_name = "feature_request" endpoint = f"{supabase_url}/rest/v1/{table_name}" supabase_key = "<my-supabase-project-api-key>" ## The request will fail if either of apikey or Authorization are not provided headers = { "apikey": supabase_key, "Authorization": f"Bearer {supabase_key}", "Content-Type": "application/json", "Prefer": "return=representation" # This returns the inserted row } data = {"text": "this is a new feature request ..."} response = requests.post(endpoint, json=data, headers=headers) response.json() # [{'id': 1, # 'created_at': '2025-01-02T16:52:44.738549+00:00', # 'text': 'this is a new feature request ...'}] And visiting the table in the Supabase dashboard confirms that the data is inserted as a new row. ...

2025-01-02 · 1 min

GROUP BY ALL in Bigquery

I came across this Linkedin post from a Google engineer, on a new (in preview) and very interesting BigQuery syntax: GROUP BY ALL. This will save time when writing and specially modifying complex SQL queries on BigQuery. The GROUP BY ALL clause groups rows by inferring grouping keys from the SELECT items. It will exclude expressions with aggregate and window functions, constants, and query parameters for a smart GROUP BY. So instead of GROUP BY name, city, device, browser, date or GROUP BY 1, 2, 3, 4, 5 you would use GROUP BY ALL. ...

2024-02-28 · 1 min