Skip to main content

2 posts tagged with "rawsql"

View All Tags

Optional Redis and Property-Level RawSQL

· One min read
TeaQL Code Gen
Core Contributor

Optional Redis significantly lowers deployment barriers. Property-level RawSQL increases query flexibility.

Optional Redis

+ Redis is now an optional dependency
+ LocalLockService: in-memory lock for non-Redis environments
+ RedisLockService: distributed lock when Redis is available
+ TQLAutoConfiguration: conditionally loads based on classpath

Before: spring-boot-starter-data-redis was mandatory.

After: Works without Redis, automatically falling back to local locks.

Property-Level RawSQL

@RawSQL("CONCAT(first_name, ' ', last_name)")
String getFullName();

Three levels fully supported: Property-level, Criteria-level, Select-level.

Aggregation Function Prefixes

+ Configurable prefix for aggregation result columns
+ Prevents column name conflicts in multi-aggregation queries

Request Pagination

Generated Request classes automatically include page and pageSize fields.

Expression orElse/orElseThrow

String name = Q.user().name().orElse("Unknown");
String email = Q.user().email()
.orElseThrow(() -> new BusinessException("Email required"));

Aligns with Java Optional conventions.

RawSQL Queries and Model Visualization

· One min read
TeaQL Code Gen
Core Contributor

Full RawSQL support plus a suite of model visualization tools.

RawSQL Three-Level Support

// WHERE clause
Q.orders().filter(
RawSqlCriteria.of("EXTRACT(YEAR FROM create_time) = 2025")
).executeForList(ctx);
+ RawSQL in search criteria (WHERE)
+ RawSQL in select projections
+ RawSQL in criteria expressions

Data Design Documentation Generator

Generates Markdown documentation from domain models, including ER diagrams, field descriptions, and relationship docs.

HTML Model Browser

A searchable, interactive domain model browser:

+ HTML model viewer: interactive domain model browser
+ Searchable entity list
+ Relationship visualization
+ Table relation count display

Word Cloud Visualization

Domain model word cloud with concept sizing based on entity importance.

Other Improvements

  • Optimized error reporting (line numbers, original SQL, parameter values)
  • startsWith / endsWith naming fix
  • gt/lt operators restricted to numeric types