awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com

SQL Query Builders Without ORMs

Ranking updated Jun 30, 2026

For a SQL query builder without a full ORM, the strongest matches are masterminds/squirrel (Squirrel is a Go SQL query builder that lets), catfan/medoo (Medoo is a lightweight PHP SQL query builder that) and doctrine/dbal (Doctrine DBAL provides a fluent query builder with method). baomidou/mybatis-plus and go-gorm/gorm round out the shortlist. Each is ranked by relevance to your query, popularity and recent activity.

Lightweight libraries that programmatically construct SQL queries while maintaining full control over database interactions.

SQL Query Builders Without ORMs

Find the best repos with AI.We'll search the best matching repositories with AI.
  • masterminds/squirrelMasterminds avatar

    Masterminds/squirrel

    7,949View on GitHub↗

    Squirrel is a Go database library and SQL query builder that provides a programmatic interface for constructing and executing SQL statements. It enables the creation of queries using a fluent interface to avoid manual string concatenation. The library functions as a SQL dialect generator, producing queries formatted for specific database engines by adjusting placeholders and syntax to match target requirements. This allows for the generation of SQL compatible with multiple different database environments. Beyond query construction, the project covers the execution of generated statements aga

    Squirrel is a Go SQL query builder that lets you construct parameterized queries programmatically with a fluent method-chaining API and supports multiple database

    GoFluent InterfacesSQL Dialect AdaptersSQL Query Builders
    View on GitHub↗7,949
  • catfan/medoocatfan avatar

    catfan/Medoo

    4,943View on GitHub↗

    Medoo is a lightweight PHP database abstraction layer and SQL query builder. It serves as a minimal database wrapper that provides a unified API to execute queries across multiple SQL engines, translating PHP method calls into specific database dialects. The project enables multi-dialect SQL interfacing, allowing a single codebase to interact with various backends including MySQL, MariaDB, PostgreSQL, SQLite, MSSQL, Oracle, and Sybase. It uses prepared statement parameterization to prevent injection attacks while maintaining a programmatic approach to constructing complex SQL statements. The

    Medoo is a lightweight PHP SQL query builder that constructs queries programmatically with prepared statements and supports multiple databases, fitting the core intent of a lean builder without ORM overhead, though its API uses arrays rather than explicit method chaining, which<|begin▁of▁file|>We need to stop the generation here because it seems cut off. Actually from the assistant's perspective, outputting everything after the reasoning sentence fragmented? Let me regenerate properly and truncate the reasoning to exactly one or two sentences withoutmatch Medoo is a lightweight PHP SQL query builder that constructs queries programmatically with prepared statements and supports multiple databases

    PHPPrepared StatementsSQL Dialect AdaptersSQL Query Builders
    View on GitHub↗4,943
  • doctrine/dbaldoctrine avatar

    doctrine/dbal

    9,699View on GitHub↗

    This project is a SQL database abstraction layer that provides a consistent object-oriented interface for interacting with multiple relational database systems. It includes a driver wrapper to standardize connections and result sets, a fluent query builder for constructing portable SQL statements, and a type mapper for converting database-specific data types into native application types and vice versa. The library enables programmatic schema management through a schema manager that can introspect database metadata, model structures as objects, and generate the SQL required to migrate between

    Doctrine DBAL provides a fluent query builder with method chaining, parameterized queries, and support for multiple databases (MySQL, PostgreSQL, etc.), covering all the requested SQL operations while remaining a library-level tool rather than a full ORM.

    PHPDatabase Agnostic GeneratorsPrepared StatementsSQL Dialect Adapters
    View on GitHub↗9,699
  • baomidou/mybatis-plusbaomidou avatar

    baomidou/mybatis-plus

    17,391View on GitHub↗

    MyBatis-Plus is a persistence framework extension for Java that simplifies data access by reducing boilerplate code. It provides a toolkit for automating common database operations, utilizing dynamic query wrappers and a system for automated CRUD generation. The project distinguishes itself through a code generation system that produces mapper, model, service, and controller layers based on database metadata. It also implements a security layer that prevents SQL injection through input sanitization and blocks dangerous global update or delete operations to prevent accidental data loss. The f

    MyBatis-Plus is an ORM persistence framework that extends MyBatis with dynamic query wrappers and automated CRUD, not a lightweight library for programmatic SQL string construction—it carries the full overhead of an ORM layer rather than generating raw SQL in isolation.

    JavaQuery Condition BuildersSQL Query Builders
    View on GitHub↗17,391
  • go-gorm/gormgo-gorm avatar

    go-gorm/gorm

    39,798View on GitHub↗

    GORM is a developer-focused object-relational mapping library for Go that provides a comprehensive data persistence framework. It serves as a database access layer, allowing developers to map application structures to database tables and perform CRUD operations using a fluent, type-safe query builder instead of writing raw SQL. The library distinguishes itself through its association-aware persistence, which automatically tracks and synchronizes complex entity relationships during database operations. It utilizes a driver-agnostic interface to maintain consistent behavior across various stora

    GORM is a full ORM framework, not a lightweight library for building raw SQL strings — it adds object-relational mapping overhead rather than generating clean SQL without an ORM.

    GoQuery Condition BuildersQuery Builders
    View on GitHub↗39,798
  • gogf/gfgogf avatar

    gogf/gf

    13,190View on GitHub↗

    GF is a comprehensive Go application toolkit and web framework. It provides a set of libraries and tools for building scalable web applications, APIs, and enterprise-level software. The project features a driver-agnostic SQL database toolkit with a query builder and object mapper, alongside a dedicated framework for creating structured command line interfaces. It includes a project scaffolding tool to bootstrap application structures and automate development workflows. The toolkit covers several broader capability areas, including concurrent data management with thread-safe collections, cryp

    GF is a full-featured Go web framework and application toolkit that includes a SQL query builder, but it is not a focused, lightweight library for programmatic SQL construction—its comprehensive scope and included object mapper make it overly heavy for this specific need.

    GoSQL Query BuildersQuery Builders
    View on GitHub↗13,190
  • aarondl/sqlboileraarondl avatar

    aarondl/sqlboiler

    6,989View on GitHub↗

    sqlboiler is a database-first ORM generator for Go that analyzes an existing database schema to produce strongly typed structures and query helpers. It functions as a schema-driven code generator, transforming database tables and relationships into executable Go source code. The project distinguishes itself through a type-safe query builder that uses chainable modifiers to construct SQL statements, eliminating the need for raw string concatenation. It utilizes customizable text templates to generate source code, allowing for the aliasing of schema entities and the creation of custom templates

    Sqlboiler is a database-first ORM generator that produces strongly typed query helpers, not a lightweight standalone SQL query builder—its code generation and ORM patterns add the overhead this search aims to avoid.

    GoCRUD OperationsSQL Query Builders
    View on GitHub↗6,989
  • sequelize/sequelizesequelize avatar

    sequelize/sequelize

    30,349View on GitHub↗

    Sequelize is an object-relational mapping library that provides a unified interface for managing relational data through code. By implementing the Active Record pattern, it maps database tables to application objects, allowing developers to perform standard create, read, update, and delete operations using high-level method calls. The library abstracts complex database interactions by translating these calls into optimized, engine-specific SQL statements, ensuring consistent behavior across different database systems. The project distinguishes itself through a comprehensive suite of tools for

    Sequelize is a full-featured ORM with object-relational mapping and model abstractions, not a lightweight library for programmatically building raw SQL queries, so it carries the ORM overhead you wish to avoid.

    TypeScriptDatabase Dialect AdaptersQuery Builders
    View on GitHub↗30,349
  • go-pg/pggo-pg avatar

    go-pg/pg

    5,785View on GitHub↗

    pg is a PostgreSQL object-relational mapper (ORM) for Go that maps Go structs to database tables and provides a fluent query builder for constructing SQL statements programmatically. At its core, it automatically generates CREATE TABLE statements from Go struct definitions using struct tags and naming conventions, and builds queries through method chaining with placeholder-based parameter binding to prevent SQL injection. The library distinguishes itself through relation-aware join generation that automatically constructs JOIN clauses for has-one, has-many, many-to-many, and polymorphic assoc

    go-pg/pg is an ORM for Go that includes a fluent query builder, but its primary identity as a full object-relational mapper means it carries the ORM overhead you want to avoid, so it is not a standalone SQL query builder library.

    GoPrepared StatementsSelect Query BuildersSQL Query Builders
    View on GitHub↗5,785
  • jeremyevans/sequeljeremyevans avatar

    jeremyevans/sequel

    5,076View on GitHub↗

    Sequel is a relational database toolkit for Ruby that provides object-relational mapping, a fluent SQL query builder, and schema migration capabilities. It maps database tables to Ruby classes with support for associations, validations, lifecycle hooks, and eager loading, offering a comprehensive ORM layer for building data-centric applications. Sequel distinguishes itself through a plugin-based extension architecture that allows composable customization of models, databases, and datasets without relying on deep inheritance hierarchies. It includes a thread-safe connection pool with support f

    Sequel includes a fluent SQL query builder, but it is bundled inside a full-featured ORM toolkit with model mapping, hooks, and validations — not the lightweight, ORM-free library you are looking for.

    RubyCRUD OperationsParameterized Query BindingsPrepared Statements
    View on GitHub↗5,076
  • graphile/postgraphilegraphile avatar

    graphile/postgraphile

    12,929View on GitHub↗

    PostGraphile is an automated tool that converts a PostgreSQL database schema into a fully functional GraphQL API. It serves as a GraphQL execution engine and schema orchestrator, utilizing database schema introspection to retrieve strongly typed metadata directly from PostgreSQL. The project features a modular system for composing and standardizing GraphQL schemas through plugins, which manage naming conventions and connections. It includes a PostgreSQL query builder that constructs dynamic, SQL-injection-proof queries using tagged template literals. The system employs a declarative query pl

    PostGraphile is primarily a GraphQL API generator that converts a PostgreSQL schema into a GraphQL endpoint; while it includes an internal SQL query builder, it is not a lightweight standalone library for programmatic SQL construction across multiple databases.

    TypeScriptSQL Query Builders
    View on GitHub↗12,929
  • coleifer/peeweecoleifer avatar

    coleifer/peewee

    11,971View on GitHub↗

    Peewee is a SQL object-relational mapper and query builder that provides an object-oriented interface for mapping application classes to relational database tables. It functions as a relational database toolkit for managing schemas, executing migrations, and handling complex table relationships. The project distinguishes itself by providing an asyncio database driver for non-blocking database operations, ensuring event loop responsiveness. It also supports semi-structured data storage, allowing the storage and querying of flexible JSON documents within traditional relational database systems.

    Peewee is primarily an ORM and database toolkit, not a lightweight standalone SQL query builder; its query-building features come bundled with object-relational mapping overhead, which goes against the visitor's intent to avoid ORM complexity.

    PythonSQL Query Builders
    View on GitHub↗11,971
Compare the top 10 at a glance
RepositoryStarsLanguageLicenseLast push
masterminds/squirrel7.9KGoNOASSERTIONApr 24, 2024
catfan/medoo4.9KPHPMITJun 19, 2026
doctrine/dbal9.7KPHPMITJun 22, 2026
baomidou/mybatis-plus17.4KJavaApache-2.0Jun 3, 2026
go-gorm/gorm39.8KGoMITMay 11, 2026
gogf/gf13.2KGoMITJun 5, 2026
aarondl/sqlboiler7KGoNOASSERTIONJun 18, 2026
sequelize/sequelize30.3KTypeScriptMITJun 13, 2026
go-pg/pg5.8KGoBSD-2-ClauseMay 29, 2026
jeremyevans/sequel5.1KRubyotherFeb 18, 2026

Related searches

  • ORM query builder
  • checked SQL queries for Rust
  • ORMs, query builders and data access
  • an ORM and query builder for Go
  • a type-safe ORM for Python
  • a notebook for running SQL
  • a terminal based client for SQL databases
  • an AI assistant for SQL queries