Skip to content
excalibase
mysql
GraphQL APIstable

MySQL Support

Excalibase GraphQL supports MySQL 8.4+ with full CRUD, ENUM/JSON types, views, and stored procedures.

Self-hosting only. This is the open-source engine run standalone against your own MySQL. For MySQL projects on the hosted platform (shipped in v1.6.0), see MySQL projects.

Signed-in users on a platform MySQL project

On a platform install with MySQL projects switched on, sign-up, sign-in, refresh and api keys work exactly as on a Postgres project. The project's end users are kept in an auth database inside its own MySQL instance, and their tokens carry the same claims, so a permission such as { "owner_id": { "_eq": "X-Excalibase-User-Id" } } filters rows over GraphQL and REST alike. Email addresses compare exactly, as on Postgres: Alice@example.com and alice@example.com are two accounts.

Start with MySQL

git clone https://github.com/excalibase/excalibase-graphql.git
cd excalibase-graphql
docker-compose -f docker-compose.mysql.yml up -d

API runs on port 10001 by default.

Configuration

spring:
  datasource:
    url: jdbc:mysql://localhost:3306/yourdb
    username: youruser
    password: yourpass
    driver-class-name: com.mysql.cj.jdbc.Driver

app:
  schemas: yourdb
  database-type: mysql

Feature comparison

FeaturePostgreSQLMySQL
Queries (list, filter, paginate)✅✅
Mutations (create, update, delete)✅✅
Bulk create✅✅
Relationships (foreign keys)✅✅
ENUM types✅✅
JSON / JSONB✅✅ (JSON)
Views✅✅
Stored procedures✅✅
Subscriptions (CDC)✅✅ (via watcher)
Row-Level Security✅❌ Not applicable
Computed fields✅❌
GraalVM native binary✅✅

ENUM support

MySQL ENUMs are automatically mapped to GraphQL enum types. Given:

CREATE TABLE film (
  film_id SERIAL PRIMARY KEY,
  rating  ENUM('G', 'PG', 'PG-13', 'R', 'NC-17')
);

Excalibase generates:

enum FilmRating {
  G
  PG
  PG_13
  R
  NC_17
}

You can then filter using the enum directly:

{
  film(where: { rating: { eq: PG } }) {
    title
    rating
  }
}

JSON support

JSON columns are exposed as the JSON scalar. Filter them with hasKey, hasKeys, hasAnyKeys, contains, containedBy, isNull and isNotNull. MySQL has no JSON equality on a bound value, so eq and neq are not offered on a JSON column; compare with contains and containedBy instead:

{
  product(where: { metadata: { hasKey: "color" } }) {
    name
    metadata
  }
}

Stored procedures

Define a stored procedure in MySQL:

DELIMITER //
CREATE PROCEDURE get_top_rentals(IN limit_count INT)
BEGIN
  SELECT film_id, title, COUNT(*) as rental_count
  FROM film JOIN inventory USING (film_id)
  JOIN rental USING (inventory_id)
  GROUP BY film_id
  ORDER BY rental_count DESC
  LIMIT limit_count;
END //

Call it via GraphQL mutation:

mutation {
  callGetTopRentals(limit_count: 10)
}

Views

Database views are exposed as read-only types — queries work normally, mutations are disabled. This is useful for exposing pre-joined or pre-aggregated data without extra API work.