GroupeZ Docs

Introduction

Sarah is a powerful Java library designed to simplify database management with an intuitive and elegant API. Whether you're building a Minecraft plugin or any Java application, Sarah provides a clean abstraction over raw SQL while maintaining full control over your database operations.

What is Sarah?

Sarah is a database management library that provides:

  • Simple Database Connections - Support for MySQL, MariaDB, and SQLite with minimal configuration
  • Migration System - Automatic schema versioning and migration tracking
  • Query Builder - Fluent API for building type-safe SQL queries
  • Object Mapping - Automatic mapping between database rows and Java objects (DTOs)
  • Connection Pooling - Built-in HikariCP support for optimal performance

Why Use Sarah?

Before Sarah (Raw JDBC)

try (Connection conn = dataSource.getConnection();
     PreparedStatement stmt = conn.prepareStatement(
         "INSERT INTO users (uuid, name, play_time) VALUES (?, ?, ?) " +
         "ON DUPLICATE KEY UPDATE name = ?, play_time = ?")) {
    stmt.setString(1, uuid.toString());
    stmt.setString(2, name);
    stmt.setLong(3, playTime);
    stmt.setString(4, name);
    stmt.setLong(5, playTime);
    stmt.executeUpdate();
} catch (SQLException e) {
    e.printStackTrace();
}

With Sarah

requestHelper.upsert("users", schema -> {
    schema.uuid("uuid", uuid).primary();
    schema.string("name", name);
    schema.bigInt("play_time", playTime);
});

Key Features

Multi-Database Support

Sarah supports the most popular database systems:

DatabaseClassUse Case
MySQLMySqlConnectionProduction servers
MariaDBMariaDbConnectionProduction servers
SQLiteSqliteConnectionDevelopment, small projects

Migration System

Keep your database schema versioned and organized:

public class CreateUsersTable extends Migration {
    @Override
    public void up() {
        create("users", table -> {
            table.uuid("uuid").primary();
            table.string("name", 64);
            table.bigInt("play_time").defaultValue(0);
            table.timestamps();
        });
    }
}

Fluent Query Builder

Write readable and maintainable database queries:

// Select with conditions
List<User> users = requestHelper.select("users", User.class, table -> {
    table.where("play_time", ">", 1000);
    table.orderByDesc("play_time");
});

// Insert with automatic mapping
requestHelper.insert("users", User.class, newUser);

// Delete with conditions
requestHelper.delete("users", table -> {
    table.where("uuid", playerUuid);
});

Quick Start

1. Add Dependency

Gradle:

repositories {
    maven { url 'https://repo.groupez.dev/releases' }
}

dependencies {
    implementation 'fr.maxlego08.sarah:sarah:1.26'
}

Maven:

<repository>
    <id>groupez</id>
    <url>https://repo.groupez.dev/releases</url>
</repository>

<dependency>
    <groupId>fr.maxlego08.sarah</groupId>
    <artifactId>sarah</artifactId>
    <version>1.26</version>
</dependency>

2. Create a Connection

// MySQL
DatabaseConfiguration config = DatabaseConfiguration.create(
    "username", "password", 3306, "localhost", "my_database"
);
DatabaseConnection connection = new MySqlConnection(config);

// Or SQLite
DatabaseConnection connection = new SqliteConnection(
    DatabaseConfiguration.sqlite(true),
    myPluginFolder
);

3. Start Using Sarah

RequestHelper helper = new RequestHelper(connection, logger);

// Insert data
helper.insert("players", schema -> {
    schema.uuid("uuid", playerUuid);
    schema.string("name", playerName);
});

// Query data
List<PlayerDTO> players = helper.selectAll("players", PlayerDTO.class);

Next Steps

On this page

GroupeZ MCP

Documentation in your AI

MCP lets your AI search GroupeZ documentation and read current examples to help you configure your plugins.

Read-only · No documentation API key needed

1. Copy the server URL

Transport: HTTP (Streamable HTTP). Authentication: none. Your tool uses its own model and subscription limits.

  1. Open Plugins in ChatGPT on the web, then + → Add custom MCP server.
  2. Name it ‘GroupeZ Documentation’, paste the URL above and choose ‘No authentication’. Create and install the plugin.
  3. In a conversation, type @ and select the plugin before asking. If needed, enable search, get_page and list_pages in its settings.
Official setup guide

3. Ask a question

Use GroupeZ MCP to help me create a zMenu inventory. Search relevant pages, read the examples and cite your sources.
Other clients and troubleshooting

For clients using mcpServers, adapt this example to their format:

{
  "mcpServers": {
    "groupez-docs": {
      "url": ""
    }
  }
}

Available tools are search, get_page and list_pages. Refresh the connector’s tools after updates. If your AI cannot access them, check that the connector is enabled in the conversation and your account allows custom MCP servers. Opening the URL in a browser is not an MCP test.