Package org.pjdbc.annotations
Annotation Interface DriverCapability
Declares the capabilities and metadata of a PJDBC proxy driver.
This annotation is used to generate the pjdbc.capabilities.json manifest at compile time, ensuring the manifest stays in sync with the actual driver implementations.
Example usage:
@DriverCapability(
prefix = "cache",
description = "Caches SELECT query results in memory",
capabilities = {"caching"}
)
public class CachingDriver extends AbstractProxyDriver {
// ...
}
The driver name is derived from the class name by default, but can be
overridden using the name() attribute.
- See Also:
-
Required Element Summary
Required ElementsModifier and TypeRequired ElementDescriptionA brief description of what this driver does.The URL prefix for this driver (e.g., "cache" for jdbc:cache:...). -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionString[]The capability tags for this driver.booleanWhether this driver can be composed with other drivers in a chain.Optional override for the driver name.booleanWhether this driver is a terminal driver that doesn't delegate to another JDBC driver.
-
Element Details
-
prefix
String prefixThe URL prefix for this driver (e.g., "cache" for jdbc:cache:...). This is required and must be unique across all drivers.- Returns:
- the URL subprotocol prefix
-
description
String descriptionA brief description of what this driver does. This should be a single sentence suitable for display in documentation and agent tooling.- Returns:
- the driver description
-
capabilities
String[] capabilitiesThe capability tags for this driver. These are used for discovery and categorization.Common capability tags include:
caching- Query result cachingpooling- Connection poolinglogging- SQL statement loggingtracing- Distributed tracingmetrics- Performance metricsresilience- Fault tolerance (retry, circuit breaker, etc.)security- Access control, masking, encryptiontesting- Test utilities (mock, chaos, sink)transformation- SQL modificationpassthrough- No modification to queries
- Returns:
- array of capability tags
- Default:
{}
-
name
String nameOptional override for the driver name. If not specified, the simple class name is used.- Returns:
- the driver name, or empty string to use class name
- Default:
""
-
composable
boolean composableWhether this driver can be composed with other drivers in a chain. Most drivers are composable. Set to false for drivers that must be used standalone (e.g., MockDriver).- Returns:
- true if the driver can be chained with others
- Default:
true
-
terminal
boolean terminalWhether this driver is a terminal driver that doesn't delegate to another JDBC driver. Terminal drivers (like SinkDriver, MockDriver) don't require a nested JDBC URL.- Returns:
- true if the driver doesn't delegate to another driver
- Default:
false
-