Package com.google.mu.spanner
package com.google.mu.spanner
Injection-safe template for Cloud Spanner (requires mug-spanner artifact)
Spanner SQL template with:
- Strong SQL injection safety - you cannot shoot yourself in the foot.
- Powerful dynamic SQL capability - compose subqueries flexibly (and safe from SQL injection, again).
- Compile-time semantic check - never worry about passing template parameters wrong.
- Real, actual SQL that you can copy/paste - no DSL; no XML; no StringBuilder.
- Extremely low learning curve.
ParameterizedQuery query = ParameterizedQuery.of( "SELECT id, name, age FROM Users WHERE id = {id}", userId); try (ResultSet resultSet = dbClient.singleUse().executeQuery(query.statement())) { ... }
Package Specification
The code is developed and tested under Java 8.0.-
Classes