Skip to content
CAI
Software that uses CAICheck a score

typelevel/grackle

65.4

Adequate · 20 September 2026

19.1k

lines of production code

Scala

primary language

1

measurement over time

CAI band scale
CAI lens gauges

What this system is

Grackle is a Scala library for building GraphQL servers that compiles queries into optimized SQL for execution across multiple database backends. It supports PostgreSQL, MySQL, MariaDB, Oracle, SQL Server, SQLite, and H2 via Doobie, as well as in-memory data and JSON models via Circe. The system provides a complete GraphQL implementation including parsing, validation, and subscription support, with compile-time schema safety for Scala 2 and 3.

How it got here

2019–2021 — Core library development and multi-database support

13 changes.

The project rebranded to Grackle under the Typelevel organization, establishing a foundational GraphQL core library with AST parsing, query compilation, and introspection. This period focused on expanding database compatibility to include Oracle, SQL Server, MySQL, and MariaDB via Doobie, while introducing generic and Circe-based mapping abstractions for flexible data integration.

2022–2023 — GraphQL compiler implementation and testing

17 changes.

This period focused on implementing and validating the core GraphQL-to-SQL compiler, including comprehensive test suites for parsing, schema validation, and query execution. It also introduced Scala 3 support for compile-time literals and expanded demo applications to showcase both in-memory and PostgreSQL-backed GraphQL endpoints.

2024–2026 — multi-dialect database support

16 changes.

The project expanded its database compatibility by refactoring the SQL core and Doobie integration to support multiple dialects, including Oracle, SQL Server, H2, SQLite, MySQL, and MariaDB. This involved creating specific backend modules for each database, standardizing test data structures, and implementing dialect-specific SQL rendering logic. Comprehensive test suites and conformance checks were added to validate these new integrations and ensure stack safety.

Features

Add H2 database backend for Doobie queries

This change introduces a new H2 backend for the Grackle Doobie integration, allowing users to run queries against H2 databases in addition to existing backends like PostgreSQL and SQLite. The implementation includes \DoobieH2Mapping\ which handles H2-specific SQL dialect nuances, such as using standard OFFSET/FETCH syntax, native ILIKE support, and specific NULL ordering behavior. It also provides a test suite (\DoobieH2DatabaseSuite\ and \DoobieH2Suites\) that validates the backend against shared SQL test suites, ensuring compatibility for features like array joins, JSON handling, and mutations.

modules/doobie-h2 · high confidence

Add MariaDB backend for Grackle Doobie

This change introduces a new MariaDB backend module (\doobie-mariadb\) that enables Grackle to query MariaDB databases via Doobie. The implementation provides a \DoobieMariaDbMapping\ that adapts SQL generation to MariaDB-specific dialects, handling features such as case-insensitive \LIKE\ queries, \LIMIT\/\OFFSET\ syntax, and \CAST\ operations. It also includes a comprehensive test suite (\DoobieMariaDbSuites\) that validates core functionality including joins, mutations, JSON handling, and complex filtering against a MariaDB instance.

modules/doobie-mariadb · high confidence

Add MySQL backend support via Doobie

This change introduces a new MySQL backend for the Grackle Doobie integration, enabling users to query MySQL 8.0.14+ databases. The implementation includes \DoobieMySqlMapping\, which handles MySQL-specific SQL dialect nuances such as case-insensitive LIKE queries, LIMIT/OFFSET syntax, NULL ordering, and JSON/CAST type mappings. It also provides the necessary test infrastructure, including a Docker entrypoint script to configure character sets and a comprehensive suite of database tests to verify compatibility.

modules/doobie-mysql · high confidence

Add SQLite backend for Doobie-based GraphQL queries

A new SQLite backend is available for the Doobie integration, allowing users to run GraphQL queries against SQLite databases. This implementation bridges SQLite-specific SQL dialect differences—such as the lack of LATERAL joins, parenthesized UNION branches, and native date/time types—by adapting the shared query builder's rendering logic (e.g., using comma-form LIMIT/OFFSET and UPPER() for case-sensitive LIKE matching). The module includes a test suite that seeds an on-disk SQLite database from SQL scripts and validates core functionality including joins, filtering, pagination, and JSON handling.

modules/doobie-sqlite · high confidence

Added GraphQL benchmarking profile with PostgreSQL schema definitions

A new benchmarking profile has been introduced to the project, providing a concrete implementation of a GraphQL schema backed by PostgreSQL. This change adds a \Bench.scala\ file that defines the data model for countries, cities, and languages, including table definitions, type mappings, and query elaborators for operations like searching and filtering by population. This serves as a reference implementation and performance testing ground for the underlying GraphQL-to-SQL compiler.

profile · high confidence

Added GraphQL schema parsing benchmark using the GitHub schema

A new JMH benchmark has been added to measure the performance of parsing GraphQL schemas. The benchmark, located in \ParserBenchmark.scala\, utilizes the full GitHub GraphQL schema (defined in \github.graphql\) as its input data, allowing users to evaluate parsing throughput against a realistic, large-scale schema definition.

benchmarks · high confidence

Added Oracle database backend support

Introduced a new Oracle-specific mapping implementation in the \doobie-oracle\ module, enabling users to query Oracle databases via Grackle. This backend configures Oracle-specific SQL syntax, including \FETCH FIRST ... ROWS ONLY\ for limits, \OFFSET ... ROWS\ for pagination, \COLLATE "binary"\ for string comparison, and specific type casting (e.g., \VARCHAR\ to \CHAR\, \INTEGER\ to \NUMBER\) to ensure compatibility with Oracle's dialect.

modules/doobie-oracle/src/main · high confidence

Added SQL Server and Oracle database query scripts

New shell scripts have been added to support querying Microsoft SQL Server and Oracle databases alongside the existing PostgreSQL support. The new mssql-query.sh script executes queries using sqlcmd with hardcoded credentials, while oracle-query.sh uses sqlplus with rlwrap for interactive sessions and oracle-opts.sql provides SQL\*Plus configuration for error display and CSV output.

scripts · high confidence

Added Scala 3 version-specific syntax for compile-time GraphQL literals

Introduced \syntax3.scala\ to provide Scala 3-specific implementations of the \schema\ and \doc\ string interpolators using Scala 3 macros and the \Literally\ library. This allows users to define GraphQL schemas and documents as compile-time literals with immediate validation errors, mirroring the existing Scala 2 functionality found in \syntax2.scala\.

modules/core/src/main/scala-3 · high confidence

Added Star Wars GraphQL demo with in-memory data and custom query elaboration

The demo module now includes a new Star Wars GraphQL example that defines a schema with Character, Human, and Droid types. This entry point provides an in-memory dataset of characters and implements custom query elaboration logic to handle specific fields like 'hero' (filtering by episode) and 'character/human/droid' (filtering by ID), demonstrating how to map GraphQL queries to internal data structures using the Grackle library's generic mapping and result transformation capabilities.

demo/src/main/scala/demo/starwars · high confidence

Added demo resources: GraphQL Playground, sample database, and logging config

The demo module now includes a static GraphQL Playground interface (assets/playground.html) for interactive API exploration, a PostgreSQL 'World' database schema and seed data (db/world.sql) for database-backed examples, and a Logback configuration (logback.xml) that sets console logging to INFO while suppressing Flyway migration logs.

demo/src/main/resources · high confidence

Demo application now serves Star Wars and World GraphQL APIs via Ember server

The demo module has been restructured to provide a runnable entry point (Main.scala) that initializes and exposes two distinct GraphQL endpoints: 'starwars' and 'world'. These endpoints are powered by new service implementations (GraphQLService.scala) that handle both GET and POST requests, and are served by a new HTTP server (DemoServer.scala) built on http4s Ember. The server configuration includes logging and error handling, allowing users to interact with the Grackle mappings directly through a local HTTP interface.

demo/src/main/scala/demo · high confidence

Demo now supports PostgreSQL-backed data queries

The demo application has been updated to include a new \demo.world\ package that provides a concrete implementation for querying a PostgreSQL database. This change introduces \WorldData.scala\ to manage database connections via a HikariCP transactor and \WorldMapping.scala\ to define the GraphQL schema and SQL mappings for entities like Country, City, and Language. Users can now run the demo against a live PostgreSQL instance to test GraphQL queries that resolve data from database tables, moving beyond the previous in-memory or simplified data models.

demo/src/main/scala/demo/world · high confidence

Generic mapping implementation for Scala 2

The generic mapping module now includes a Scala 2-specific implementation (genericmapping2.scala) that utilizes Shapeless to derive cursor builders for product and coproduct types, enabling automatic field mapping and type narrowing for Scala 2 users.

modules/generic/src/main/scala-2 · high confidence

Grackle rebrands to Typelevel and adds multi-database support

The project has moved to the Typelevel organization and rebranded from gsp-graphql to Grackle, now supporting GraphQL queries, mutations, and subscriptions. It introduces new database backends for Oracle, SQL Server, MySQL, and MariaDB via Doobie, alongside existing Postgres support. The license has changed to Apache 2.0, and CI has migrated from Travis to GitHub Actions with Docker Compose for local database testing.

(repo-wide) · high confidence

Initial SQL Server backend for Doobie mapping

Added a new SQL Server (MSSQL) backend implementation in the \DoobieMSSqlMapping\ module. This introduces MSSQL-specific SQL generation behaviors, including proper OFFSET/FETCH pagination syntax, case-insensitive LIKE handling via UPPER(), and custom NULL ordering logic for ORDER BY clauses to accommodate SQL Server's lack of explicit NULLS FIRST/LAST support. It also handles qualified name folding in union branches and specific type casting for NULL values.

modules/doobie-mssql/src/main · high confidence

Initial release of the Grackle GraphQL core library

This change introduces the core module for the Grackle GraphQL library, providing the foundational components for building GraphQL servers in Scala. It includes a complete Abstract Syntax Tree (AST) definition for GraphQL documents, a parser built on cats-parse to convert query strings into the AST, and a query compiler that transforms the AST into an internal query algebra. The module also defines the Mapping abstraction for connecting GraphQL schemas to data sources, a Cursor interface for navigating data during query execution, and a full implementation of the GraphQL introspection system. Additionally, it provides utilities for query minimization and structured error reporting via the Problem type.

modules/core/src/main/scala · high confidence

Introduce Circe-based JSON mapping support

Added a new \circe\ module that enables mapping GraphQL queries against Json value-backed models. This introduces \CirceMapping\ and \CirceCursor\ implementations, allowing users to define root effects and field mappings that operate directly on \io.circe.Json\ structures, including support for streaming results and custom scalar handling.

modules/circe/src/main · high confidence

Introduces generic cursor building and mapping abstractions

The generic module now provides a new \CursorBuilder\ trait and \GenericMapping\ infrastructure to handle the construction of GraphQL cursors from Scala types. This change adds implicit builders for primitive types (String, Int, Long, Float, Double, Boolean) and collection types (Option, List), along with support for Scala enumerations. It also introduces \GenericField\ mappings and a \semiauto\ derivation API, allowing users to define object and interface cursor builders with field renaming and transformation capabilities.

modules/generic/src/main/scala · high confidence

New build-time test data generation for multi-database seeding

The build now includes a new \GenTestData\ module that automatically generates database initialization scripts for Postgres, Oracle, SQL Server, SQLite, H2, and MySQL from shared CSV test data. This replaces manual script maintenance by parsing dialect-specific SQL schemas and rendering CSV rows as INSERT statements, with dialect-aware handling for types like arrays, timestamps, and booleans. A \NewDataset\ helper is also added to scaffold new test datasets with the correct schema skeletons for each database.

project · high confidence

PostgreSQL-specific Doobie mapping and test infrastructure

The \modules/doobie-pg\ module now provides the concrete PostgreSQL implementation for the Doobie database layer. This includes \DoobiePgMapping\, which wires up the PostgreSQL-specific transactor and SQL mappings, and a comprehensive suite of test fixtures (\DoobiePgDatabaseSuite\, \DoobiePgSuites\) that validate data types (UUID, JSONB, dates), queries, mutations, and edge cases against a live PostgreSQL database. This change modularizes the PostgreSQL backend, separating it from generic SQL logic to support potential non-Postgres backends in the future.

modules/doobie-pg, modules/sql-pg · high confidence

Behavioural changes

Doobie integration refactored for version 1.0.0-RC13

The Doobie database integration in modules/doobie-core has been updated to support Doobie 1.0.0-RC13, introducing a new modular architecture with dedicated \DoobieMapping\, \DoobieMonitor\, and companion traits. This change replaces the previous \fromTransactor\ API with a new \mkMapping\ factory method (marking the old method as deprecated) and implements the updated Doobie Fragment and Meta APIs, enabling better support for non-Postgres database backends and structured table name handling.

modules/doobie-core · high confidence

SQL core module refactored for multi-dialect support and new LIKE predicate

The SQL core module has been restructured to support non-Postgres database backends by introducing a dialect-agnostic \SqlModule\ trait and abstracting SQL fragment rendering. This includes a new \Like\ predicate implementation for Scala 2 and 3 that converts SQL patterns to regular expressions, and a \FailedJoin\ sentinel to optimize equality checks. Additionally, table names are now handled via a structured \TableName\ class to correctly manage schema qualifiers and identifier folding, and offset/limit normalization is applied at render time to ensure compatibility with dialects like MSSQL and SQLite.

modules/sql-core/src/main · high confidence

Skunk database backend refactored for cross-platform compatibility

The Skunk integration has been modularized and restructured to support non-Postgres database backends and cross-compilation to JavaScript and Native platforms. The core mapping logic (\SkunkMapping\) and test suites (\SkunkDatabaseSuite\, \SkunkSuites\) have been moved to shared and cross-platform directories, introducing a unified test framework that allows SQL-based tests to run against different database implementations. This change also includes the addition of subscription support via \SubscriptionMapping\ and \SubscriptionSuite\, enabling real-time data updates through PostgreSQL channels.

modules/skunk · high confidence

Standardized test data structure with multi-dialect schema support

The test data directory has been restructured to use a shared CSV format for row data across all supported databases (PostgreSQL, Oracle, SQL Server, SQLite, H2, and MySQL), with dialect-specific SQL schema files handling type differences. This change introduces a new data format where NULLs are represented as \\N and columns with dialect-specific value spellings (such as arrays, dates, and booleans) are annotated in the CSV header, ensuring consistent test data while accommodating database-specific constraints and types.

testdata · high confidence

Test coverage

Added Circe module test suite; Added GraphQL September 2025 conformance test suites; Added Oracle backend test suite; Added SQL Server backend test suite; Added Star Wars GraphQL test suite; Added comprehensive parser test suite; Added comprehensive test suites for the GraphQL compiler; Added property-based test generators for AST components; Added property-based tests for Result laws; Added test coverage for GraphQL schema and type extensions; Added test coverage for query minimization and rendering; Added test coverage for schema validation and value rendering; Added test suite for SDL parsing and schema definitions; Added test suite for composed GraphQL mappings; Added test utilities for GraphQL response validation; Added tests for ValueEffect cursor construction; Added tests for mapping validation errors; Added tests for subscription mapping and execution; Added tests for validator stack safety; Expanded SQL test coverage for array joins, coalescing, and composite keys.

Dependencies

Major dependency and build infrastructure overhaul

This change updates the project's dependency versions to their latest releases, including Scala 2.13.18 and 3.3.8, Cats 2.13.0, Cats Effect 3.7.1, Doobie 1.0.0-RC13, and http4s 0.23.37, while also adding drivers for multiple database backends (PostgreSQL, MySQL, MariaDB, Oracle, SQL Server, SQLite, H2). The build configuration has been significantly restructured to use sbt-typelevel conventions, introducing new tasks for managing Docker-based test databases (Postgres, Oracle, SQL Server, MySQL, MariaDB) and integrating GitHub Actions workflows for CI, coverage reporting, and site publishing.

(dependencies) · high confidence

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

How this codebase got here

Baseline

  • First survey — no prior run to compare against. CAI 65.

Lenses

  • Code Health 84
  • Architecture 100
  • Maturity 56
  • Readiness 68
  • Security 72

Changes since last survey

  • 300 commits — 270 feature/other, 30 fixes

By area

  • (repo) — 134 commits
  • (root) — 58 commits
  • modules/core — 32 commits
  • modules/sql-core — 22 commits
  • project/plugins.sbt — 14 commits
  • project/build.properties — 12 commits
  • .github/workflows — 4 commits
  • modules/circe — 4 commits
  • modules/doobie-mssql — 3 commits
  • modules/doobie-core — 2 commits
  • modules/doobie-h2 — 2 commits
  • docs/howto — 1 commit
  • docs/tutorial — 1 commit
  • modules/doobie-mariadb — 1 commit
  • modules/doobie-mysql — 1 commit
  • modules/doobie-oracle — 1 commit
  • modules/doobie-sqlite — 1 commit
  • modules/skunk — 1 commit
  • testdata/coalesce — 1 commit
  • testdata/null-ordering — 1 commit

Notable commits

  • fix: Add missing test cases for variables and fix for absent value
  • fix: Fix Binding Value rendering
  • fix: Fix NULL placement in MSSQL ORDER BY rendering
  • fix: Fix list coercion, variable usage validation and argument defaults
  • fix: Merge pull request #832 from rpiaggio/fix-numeric
  • fix: Merge pull request #862 from phdoerfler/fix/mssql-utc-timezone-pin
  • fix: Merge pull request #867 from phdoerfler/fix/issue-743
  • fix: Merge pull request #870 from phdoerfler/fix/mssql-null-ordering
  • fix: Merge pull request #871 from phdoerfler/fix/issue-342
  • fix: Merge pull request #876 from phdoerfler/fix/issue-174-root-type-validation
  • fix: Merge pull request #885 from phdoerfler/fix/bigdecimal-equals-cost
  • fix: Merge pull request #886 from toddburnside/fix-fragment-diamond-false-cycle
  • fix: Merge pull request #893 from phdoerfler/fix/issue-888-nullable-parent-join
  • fix: Merge pull request #900 from typelevel/fix/f12-keyword-prefix-names
  • fix: Merge pull request #902 from typelevel/fix/f7-skip-include-combined
  • fix: Merge pull request #908 from typelevel/fix/f8-single-value-list-coercion
  • fix: Merge pull request #916 from phdoerfler/fix/shared-test-data-values
  • fix: Merge pull request #918 from typelevel/fix/err-column
  • fix: Merge pull request #919 from typelevel/fix/f10-deprecated-default-reason
  • fix: Merge pull request #920 from typelevel/fix/f9-implementation-extra-args
  • …and 280 more

Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.

Survey your own repository

typelevel/grackle was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.

About this page

  • The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
  • Measured at commit 2fdc4518815033712512c08fd887a7f7ac648e75 — the exact code this score is about.
  • Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
  • Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.