Skip to content

mikeshootzz/PostMyRustache

Repository files navigation

PostMyRustache

PostMyRustache logo

A Rust-Powered MySQL-to-PostgreSQL Translation Layer

Seamlessly run your MySQL applications on PostgreSQL without code changes

GPL License GitHub Stars

🚀 Features

  • MySQL Protocol: Accepts MySQL connections and translates queries to PostgreSQL
  • Authentication: Configurable MySQL authentication
  • High Performance: Built with Rust and async Tokio
  • Docker Ready: Easy deployment with Docker Compose
  • Query Translation: Handles MySQL-specific syntax differences

🎯 Quick Start

Using Docker Compose (Recommended)

git clone https://github.com/mikeshootzz/PostMyRustache.git
cd PostMyRustache
docker-compose up -d

# Connect with any MySQL client
mysql -h localhost -P 3306 -u admin -p
# Password: password

Manual Installation

git clone https://github.com/mikeshootzz/PostMyRustache.git
cd PostMyRustache

# Configure environment
cp .env.example .env
# Edit .env with your settings

# Build and run
cargo run --release

⚙️ Configuration

Create a .env file in the project root:

# PostgreSQL Connection
DB_HOST=localhost
DB_USER=postgres
DB_PASSWORD=your_postgres_password

# MySQL Authentication
MYSQL_USERNAME=admin
MYSQL_PASSWORD=password

# Optional
BIND_ADDRESS=0.0.0.0:3306
RUST_LOG=info

🔧 Usage

Connect using any MySQL client:

mysql -h localhost -P 3306 -u admin -p

Example queries:

CREATE DATABASE myapp;
USE myapp;

CREATE TABLE users (
    id INT AUTO_INCREMENT PRIMARY KEY,
    name VARCHAR(100),
    email VARCHAR(255)
);

INSERT INTO users (name, email) VALUES ('John Doe', 'john@example.com');
SELECT * FROM users;

🛠️ Development

# Build
cargo build

# Run with logging
RUST_LOG=debug cargo run

# Run tests (single-threaded to avoid env var conflicts)
cargo test -- --test-threads=1

# Format code
cargo fmt

# Run clippy linting
cargo clippy

# Security audit
cargo audit

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests
  5. Submit a pull request

📄 License

This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details.


Made with ❤️ and 🦀 Rust

About

A Rust-Powered MySQL-to-PostgreSQL Translation Layer

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •