DEV.co
Open-Source Databases · sagframe

sagacity-sqltoy

Sagacity-SqlToy is a Java ORM framework combining JPA-style CRUD operations with advanced SQL query capabilities, designed for complex business logic, multi-tenant SaaS systems, and large-scale data analytics. It provides features like cache translation, optimized pagination, hierarchical grouping, row-column transformations, and automatic database dialect adaptation.

Source: GitHub — github.com/sagframe/sagacity-sqltoy
1.2k
GitHub stars
188
Forks
Java
Primary language
Apache-2.0
License (OSI-approved)

Key facts

Objective fields from the source. Values we can't verify are shown as “Unknown” rather than guessed.

FieldValue
Repositorysagframe/sagacity-sqltoy
Ownersagframe
Primary languageJava
LicenseApache-2.0 — OSI-approved
Stars1.2k
Forks188
Open issues3
Latest release5.6.85 (2026-07-04)
Last updated2026-07-04
Sourcehttps://github.com/sagframe/sagacity-sqltoy

What sagacity-sqltoy is

SqlToy unifies object persistence (save, update, delete, cascade) with flexible SQL querying through XML or inline code, supporting dynamic SQL conditions, multi-database dialect handling, sharding, encryption, data masking, and analytical operations (pivot tables, year-over-year comparisons, tree structures). Licensed under Apache-2.0, with Spring Boot starter integration and support for Java 8+ (separate LTS build for Java 17+).

Quickstart

Get the sagacity-sqltoy source

Clone the repository and explore it locally.

terminalbash
git clone https://github.com/sagframe/sagacity-sqltoy.gitcd sagacity-sqltoy# follow the project's README for install & configuration

Need it deployed, integrated, or customized instead? DEV.co ships production installs.

Best use cases

Multi-Tenant SaaS ERP Systems

Built-in multi-tenant filtering, unified data permission enforcement, and anti-privilege escalation checks; handles complex queries with automatic tenant isolation and supports large transaction volumes.

Analytics & Reporting Platforms

Native support for pivoting, grouping, aggregation, row-column transformations, and comparative analysis (YoY/WoW); scales to billion-record datasets via support for MPP databases (Doris, StarRocks, ClickHouse).

Multi-Database & Legacy System Integration

Automatic SQL dialect conversion across MySQL, Oracle, PostgreSQL, Db2, SQLServer, and 15+ others; simplifies migration and allows single codebase to target different production databases.

Implementation considerations

  • Requires SQL schema design and POJO generation via quickvo tool; teams should allocate time for schema review and POJO validation before development.
  • XML-based SQL definitions (optional but recommended) need governance: versioning, code review, and organization as codebase scales to hundreds of queries.
  • Multi-database support requires testing against target databases early; dialect-specific functions (e.g., Oracle analytic functions) should be validated in pre-production.
  • Multi-tenant and encryption features are opt-in; enable only if required, to avoid configuration complexity and performance overhead.
  • Spring Boot 3+ requires Java 17+; Java 8 users must use version 5.6.85.jre8 (EOL June 2026); plan migration timeline accordingly.

When to avoid it — and what to weigh

  • Lightweight/Microservice Projects — SqlToy's rich feature set and XML-based configuration carry overhead; lightweight ORMs (Spring Data JPA, Mybatis) may be simpler for CRUD-only microservices.
  • Team Unfamiliar with JPA & SQL — Requires developers comfortable writing SQL and understanding ORM lifecycle; the dynamic SQL condition syntax (#[] notation) has a learning curve versus more declarative query builders.
  • Real-Time Streaming or Event-Driven Architectures — SqlToy is optimized for request-response and batch workloads; not designed for Kafka consumers, event sourcing, or CQRS patterns where other tools (Flink, Spring Cloud Stream) are more natural.
  • Non-SQL Data Sources Only — MongoDB and Elasticsearch support exist but are secondary; if your primary data store is NoSQL, frameworks built for NoSQL (Spring Data Mongo, Elasticsearch client) are better fits.

License & commercial use

Apache License 2.0 (Apache-2.0): permissive open-source license allowing commercial use, modification, and distribution with minimal restrictions. Requires license and copyright notice in distributions.

Apache-2.0 is a well-established permissive OSI-approved license. Commercial use is explicitly permitted. No vendor lock-in; source code availability allows internal forking if needed. No commercial support terms visible in repository; community-driven (QQ group, GitHub issues). Enterprise support availability is Unknown.

DEV.co evaluation signals

Editorial assessment — not user reviews. Directional, with an explicit confidence level.

SignalAssessment
MaintenanceActive
DocumentationAdequate
License clarityClear
Deployment complexityModerate
DEV.co fitGood
Assessment confidenceHigh
Security considerations

Dynamic SQL conditions (#[] notation) are parameterized by design, mitigating SQL injection. Encryption (at-rest), data masking, and data permission filtering are built-in. Multi-tenant isolation and anti-privilege escalation checks are available. Review custom filters and data-permission logic in your specific implementation; no third-party security audit noted in repository.

Alternatives to consider

Mybatis / Mybatis-Plus

Similar SQL-first philosophy with simpler XML syntax and no ORM overhead; Mybatis-Plus adds auto-CRUD generation. Lighter weight for CRUD-heavy applications; larger ecosystem. Less opinionated on analytics and multi-tenant patterns.

Hibernate / Spring Data JPA

Mature JPA standard with stronger community support and tooling. Better for object-centric design; however, less control over SQL and fewer built-in analytics (pivots, grouping). Default choice in many Spring Boot projects.

Jooq

Type-safe SQL DSL with code generation and excellent multi-database support. Strong for complex queries and analytics; steeper learning curve and not true ORM. Better for teams preferring functional query builders over XML.

Software development agency

Build on sagacity-sqltoy with DEV.co software developers

Review the quickstart demo, run a proof-of-concept against your target database, and validate multi-tenant or analytics requirements in your tech stack. Start with the hello-world example and assess fit within your team's Java/Spring Boot expertise.

Talk to DEV.co

Related open-source tools

Surfaced by semantic similarity across the DEV.co open-source index.

sagacity-sqltoy FAQ

Can I use SqlToy with Spring Boot 3.x and Java 17+?
Yes, version 5.6.85 supports Java 17+ and Spring Boot 3.x. Java 8 users must use 5.6.85.jre8 (EOL June 2026).
Do I have to write SQL in XML, or can I write it in Java code?
Both: simple queries can be written inline in code; complex or frequently-modified queries are recommended in XML for reusability and management.
Does SqlToy handle multi-database deployments automatically?
Yes, it detects the target database and auto-adapts SQL functions and dialects. However, you should test SQL on all target databases early in development.
Is there commercial support available?
Not explicitly stated in the repository. Community support is available via QQ group (531812227) and GitHub issues. Consider evaluating internal support capability or hiring experienced contributors.

Work with a software development agency

From first prototype to production, DEV.co delivers software development services around tools like sagacity-sqltoy. Our software development agency staffs experienced software developers and web developers for custom software development, web development, integrations, and ongoing support across open-source databases and beyond.

Ready to Evaluate SqlToy for Your Project?

Review the quickstart demo, run a proof-of-concept against your target database, and validate multi-tenant or analytics requirements in your tech stack. Start with the hello-world example and assess fit within your team's Java/Spring Boot expertise.