Skip to content

com.planetscale.planetscale-core-api 1.0-SNAPSHOT

Install 1/2: Add this to pom.xml:
Learn more about Maven or Gradle
<dependency>
  <groupId>com.planetscale</groupId>
  <artifactId>planetscale-core-api</artifactId>
  <version>1.0-SNAPSHOT</version>
</dependency>
Install 2/2: Run via command line
$ mvn install

About this package

Planetscale/J: Core API

This package provides API definitions for the Planetscale/Java connector. It is not meant for direct consumption
by end-users; see the impl-h2 package for a reference implementation, and the impl-mysqlj package
for the main implementation used by the real driver.

Architecture

This library uses as few dependencies as possible, and exposes its own interfaces and Service Loader-based
mechanism for resolving the appropriate implementation to use.

Then, these powers combine to form the actual driver, which is exported in a POM-only module called driver.
Users install that package to automatically pull in the appropriate API and implementation.

graph TD
    subgraph Planetscale
        region1["Service LB (Region 1)"]
        region2["Service LB (Region 2)"]
    end
    subgraph Planetscale/J
        driver[Driver: `com.planetscale.Driver`] -- Uses --> api["API (this package)"]
        api -- Loads --> impl[Implementation Modules]
        impl -- Delegates to --> backing[Backing Driver]
        backing --> region1
        backing --> region2
    end
    subgraph User Code
        consumer[JDBC: `jdbc:planetscale://...`] --> driver
    end

Limitations

At the moment, it is intentional that only one implementation may be loaded and used at any given time. Later, this may
become configurable, at which time this restriction will be lifted.

Available Implementations

  • H2: Designed for speed, and used for testing the adapter interface independent of MySQL.
  • MySQL/J: The main implementation, which uses the official MySQL JDBC driver under the hood.

Writing an Implementation

The interface to implement is PlanetscaleAdapter, which is in charge of adapting JDBC to a driver implementation
of some kind, and has the chance to override various JDBC behaviors.

More abstract implementations are anticipated for the future.

Details

  • @elide-dev elide-dev
  • November 09, 2023
  • 2 dependencies
  • MIT License

Assets


Download activity

  • Total downloads 1
  • Last 30 days 0
  • Last week 0
  • Today 0

Recent versions

View all