jensovic/dbmysync-addin

Database synchronization endpoint - Provides REST API to expose MySQL database structure and keys for comparison

Maintainers

Package info

github.com/Jensovic/dbmysync-addin

pkg:composer/jensovic/dbmysync-addin

Statistics

Installs: 15

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.1.0 2026-02-01 19:03 UTC

This package is auto-updated.

Last update: 2026-03-29 19:32:19 UTC


README

Database synchronization endpoint for MySQL databases.

Installation

composer require jensovic/dbmysync-addin

Usage

1. Create endpoint in your project

<?php
require_once 'vendor/autoload.php';

use Jensovic\DbMySyncAddin\Endpoint;

$config = [
    'db_host' => 'localhost',
    'db_name' => 'your_database',
    'db_user' => 'your_user',
    'db_pass' => 'your_password',
    'secret' => 'your-secret-key-here'
];

$endpoint = new Endpoint($config);
$endpoint->handle();

2. API Endpoints

All requests require X-DbSync-Secret header with your secret key.

Health Check

GET /endpoint.php?action=health

Get all tables schema

GET /endpoint.php?action=schema

Get specific table schema

GET /endpoint.php?action=schema&table=users

Response Format

{
    "success": true,
    "data": {
        "tables": [
            {
                "name": "users",
                "columns": [...],
                "primary_keys": [...],
                "foreign_keys": [...],
                "indexes": [...]
            }
        ]
    }
}

License

MIT