Annotation Interface DriverCapability


@Documented @Retention(RUNTIME) @Target(TYPE) public @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 Elements
    Modifier and Type
    Required Element
    Description
    A brief description of what this driver does.
    The URL prefix for this driver (e.g., "cache" for jdbc:cache:...).
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The capability tags for this driver.
    boolean
    Whether this driver can be composed with other drivers in a chain.
    Optional override for the driver name.
    boolean
    Whether this driver is a terminal driver that doesn't delegate to another JDBC driver.
  • Element Details

    • prefix

      String prefix
      The 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 description
      A 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[] capabilities
      The capability tags for this driver. These are used for discovery and categorization.

      Common capability tags include:

      • caching - Query result caching
      • pooling - Connection pooling
      • logging - SQL statement logging
      • tracing - Distributed tracing
      • metrics - Performance metrics
      • resilience - Fault tolerance (retry, circuit breaker, etc.)
      • security - Access control, masking, encryption
      • testing - Test utilities (mock, chaos, sink)
      • transformation - SQL modification
      • passthrough - No modification to queries
      Returns:
      array of capability tags
      Default:
      {}
    • name

      String name
      Optional 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 composable
      Whether 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 terminal
      Whether 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