Skip to main content

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.