-
Notifications
You must be signed in to change notification settings - Fork 0
Home
title: sql-parser summary: "Squeal — a SQLite CREATE TABLE and SELECT parser in C#, built with the Superpower parser-combinator library for the CodeCrafters 'build your own SQLite' challenge." tags: [sql-parser, squeal, overview, sql, parser, parser-combinator, superpower, csharp, index] created: 2026-06-25 status: draft
sql-parser holds Squeal, a C# parser for a subset of SQLite's SQL, built for the CodeCrafters "build your own SQLite" challenge. It parses two statement families — CREATE TABLE data-definition and SELECT queries — using the Superpower parser-combinator library, where a tokenizer turns SQL text into tokens and combinators assemble those tokens into record-based syntax trees.
Squeal is deliberately scoped to the minimum the challenge needs rather than full SQLite coverage. It parses CREATE TABLE with column types and the common column constraints, and SELECT for column lists, SELECT *, SELECT count(*), and simple WHERE predicates.
Architecture describes the two parsers — the Ddl and Sql tokenizers, the Superpower combinators that build each statement, and the record types that make up the syntax tree.
- Branch-main — the only branch: both the DDL and SELECT parsers and their tests.
Squeal is a focused learning project, not a complete SQL engine. It parses single-table CREATE TABLE and SELECT statements with basic predicates; table constraints, CHECK, DEFAULT, GENERATED, and foreign keys are tokenized but left unparsed by a deliberate // todo, and INSERT, UPDATE, joins, and the other statements are out of scope. It targets net8.0 with an xUnit test suite and is not published as a package. Branch-main reports a verified build-status from dotnet build with the installed .NET SDK — it builds with two IDE0040 accessibility-modifier warnings and no errors.