zrnik/mksql

MkSQL is a tool for keeping your tables up to date with PHP code. You can use it in your project or as a database preparation in your integration tests.

v0.9.9 2021-10-22 14:05 UTC

README

GitHub PHP Version Packagist Downloads Packagist Version

What is it?

So, I just found out that the thing I created is usually called an ORM.

MkSQL is a tool for keeping your tables up to date with PHP code. It aims for a simple use cases, so it cannot handle very complex stuff. Explore the docs to see what is possible.

This package simply allows you to define entities, that represent your database tables, and automatically creates them for you.

You can also skip the ORM part and use Updater class to create your database without any entities, instead of creating them with Adminer (or PHPMyAdmin).

Documentation index is in docs/index.md file.

Requirements

This package requires you to run it with PHP 8+, as it uses the new stuff this version delivers. Mainly attributes and promoted constructor properties.

{
    "PHP": ">= 8",
    "ext-pdo": "*",

    "nette/utils": "^3.0",
    "zrnik/enum": "^1",
    
    "ext-iconv": "*",
    "ext-intl": "*"
}

Installation

composer require zrnik/mksql

Read more at Installation and Configuration page.

Supported Drivers:

This package contains a Tracy panel

Add this to your bootstrap file:

Tracy\Debugger::getBar()->addPanel(new \Zrnik\MkSQL\Tracy\Panel());

Or, if you are using Nette Framework, register it in your configuration file:

tracy: 
    bar: 
        - Zrnik\MkSQL\Tracy\Panel