Hacker News with Generative AI: SQL

Complexities of Distributed SQL (vegasecurity.com)
Query planners are a cool piece of software that exists in every database or SQL engine out there.
Show HN: BemiDB – Open-source data warehouse with zero-ETL (bemidb.com)
Cut months of pipeline work. Automatically connect any data source and query with psql.
SQL OFFSET is worse than keyset pagination (use-the-index-luke.com)
After implementing a pipelined top-N query to retrieve the first page efficiently, you will often also need another query to fetch the next pages. The resulting challenge is that it has to skip the rows from the previous pages.
Getting AI to write good SQL (cloud.google.com)
Organizations depend on fast and accurate data-driven insights to make decisions, and SQL is at the core of how they access that data. With Gemini, Google can generate SQL directly from natural language — a.k.a. text-to-SQL. This capability increases developer and analysts’ productivity and empowers non-technical users to interact directly with the data they need.
Show HN: SQL-tString a t-string SQL builder in Python (github.com/pgjones)
SQL-tString allows for t-string based construction of sql queries without allowing for SQL injection.
Which LLM writes the best analytical SQL? (tinybird.co)
We asked 19 popular LLMs (+1 human) to write analytical SQL queries to filter and aggregate a 200 million row dataset. The result is the first version of the LLM SQL Generation Benchmark.
Show HN: Convert JSON Schema to SQL DDL (github.com/VasilVelikov00)
Convert a JSON schema into SQL DDL (create table) statements.
Yahtzeeql – Yahtzee solver that's mostly SQL (github.com/charliemeyer)
Yahtzeeql - Yahtzee solver that's mostly SQL
Calculating MRR in SQL (definite.app)
A common request we see both here at Definite and from our customers is MRR reporting using Stripe data.
ToyDB rewritten: a distributed SQL database in Rust, for education (github.com/erikgrinaker)
Distributed SQL database in Rust, built from scratch as an educational project. Main features:
Pg-Schema-Diff – Diffing Postgres Schemas and Generating SQL Migrations (github.com/stripe)
Computes the diff(erences) between Postgres database schemas and generates the SQL required to get your database schema from point A to B with minimal downtime & locks. This enables you to take your database and migrate it to any desired schema defined in plain DDL.
QueryLeaf: SQL for Mongo (github.com/beekeeper-studio)
QueryLeaf is a library that translates SQL queries into MongoDB commands.
Foundation DB Record Layer SQL API (foundationdb.github.io)
The FDB relational subproject provides a SQL API for interacting with Record Layer databases.
Show HN: TextQuery – Query CSV, JSON, XLSX Files with SQL (textquery.app)
TextQuery is an all-in-one desktop app to import, query, modify, and visualize your raw data with SQL.
Fast, extensible and composable SQL sigils in Elixir (github.com/elixir-dbvisor)
Brings an extensible SQL parser and sigil to Elixir, confidently write SQL with automatic parameterized queries.
Another look into PostgreSQL CTE materialization and non-idempotent subqueries (shayon.dev)
A few days ago, I wrote about a surprising planner behavior with CTEs, DELETE, and LIMIT in PostgreSQL, a piece I hastily put together on a bus ride.
A PostgreSQL planner semi-join gotcha with CTE, LIMIT, and RETURNING (shayon.dev)
I recently discovered an unexpected behavior in PostgreSQL involving a pattern of using a Common Table Expression (CTE) with DELETE ... RETURNING and LIMIT to process a batch of items from a queue-like table. What seemed straightforward turned out to have a surprising interaction with the query planner.
Anatomy of a SQL Engine (dolthub.com)
May marks five years since Dolt adopted go-mysql-server. Today we summarize the current state of GMS by walking through a query's journey from parsing to result spooling.
Instant SQL for results as you type in DuckDB UI (motherduck.com)
Today, we’re releasing Instant SQL, a new way to write SQL that updates your result set as you type to expedite query building and debugging – all with zero-latency, no run button required. Instant SQL is now available in Preview in MotherDuck and the DuckDB Local UI.
Sqlc: Generate type-safe code from SQL (github.com/sqlc-dev)
sqlc generates type-safe code from SQL.
Show HN: Time Travel with Your SQL (ycombinator.com)
Hi, my name is Anguel and I am one of the developers of WhoDB (https://github.com/clidey/whodb)
OLAP Hierarchical Aggregation with DuckDB SQL Recursive Common Table Expressions (medium.com)
Aggregation for dimensional hierarchies doesn’t require costly Business Intelligence (BI) tools. You can use recursive SQL techniques to express your hierarchical data in relational form, allowing for easy and fast aggregation along multiple levels and dimensions.
Database Protocols Are Underwhelming (byroot.github.io)
If you’ve been in this trade for a while, you have probably seen dozens of debates on the merits and problems of SQL as a relational database query language.
Query GPT: Transform Natural Language into SQL (query-gpt.com)
Show HN: GizmoSQL – Run DuckDB as a Server with Arrow Flight SQL (github.com/gizmodata)
This is the GizmoSQL public repo - used to provide info and artifact downloads for GizmoSQL - an Apache Arrow Flight SQL server implementation using DuckDB or SQLite as a backend database.
SQL queries don't start with SELECT (2019) (jvns.ca)
Okay, obviously many SQL queries do start with SELECT (and actually this post is only about SELECT queries, not INSERTs or anything).
SQLBolt – Learn SQL (sqlbolt.com)
Welcome to SQLBolt, a series of interactive lessons and exercises designed to help you quickly learn SQL right in your browser.
Show HN: An open source SOTA SQL Agent in 1k lines of code (textql.com)
Debunking the Myth of Join Ordering: Toward Robust SQL Analytics (arxiv.org)
Join order optimization is critical in achieving good query performance. Despite decades of research and practice, modern query optimizers could still generate inferior join plans that are orders of magnitude slower than optimal.
Ask HN: A question about mentoring a junior developer (ycombinator.com)
So this is the scenario: I develop a SQL object which is being used by an application developer in an app I haven't seen before. The developer is a junior and it's clear that they have a poor understanding of the use cases they're dealing with, and likely haven't adequately tested their changes. This developer isn't on my team and isn't someone I'm directly responsible for mentoring.