PHPackages                             zrnik/mksql - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. zrnik/mksql

ActiveLibrary[Database &amp; ORM](/categories/database)

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.10.0(3y ago)01.1k[1 PRs](https://github.com/Zrnik/MkSQL/pulls)MITPHPPHP &gt;=8.0CI failing

Since Jul 20Pushed 3mo agoCompare

[ Source](https://github.com/Zrnik/MkSQL)[ Packagist](https://packagist.org/packages/zrnik/mksql)[ Docs](https://github.com/Zrnik/MkSQL)[ RSS](/packages/zrnik-mksql/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (10)Dependencies (10)Versions (52)Used By (0)

MkSQL
=====

[](#mksql)

[![GitHub](https://camo.githubusercontent.com/c6ff57c93f0409b844acea36f3cb2691ce7b57c5adace45efb30f2a6edd461a9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7a726e696b2f6d6b73716c)](https://camo.githubusercontent.com/c6ff57c93f0409b844acea36f3cb2691ce7b57c5adace45efb30f2a6edd461a9/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7a726e696b2f6d6b73716c)[![PHP Version](https://camo.githubusercontent.com/30fee767ce16fe1ded8e624210b33a4fdc99eba54d78451a108283a34bcbb92f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7a726e696b2f6d6b73716c)](https://camo.githubusercontent.com/30fee767ce16fe1ded8e624210b33a4fdc99eba54d78451a108283a34bcbb92f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7a726e696b2f6d6b73716c)[![Packagist Downloads](https://camo.githubusercontent.com/61bc97d237257256016f265618a48f165a1ff72b4f413165d4e099bb14a46f84/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f7a726e696b2f6d6b73716c)](https://camo.githubusercontent.com/61bc97d237257256016f265618a48f165a1ff72b4f413165d4e099bb14a46f84/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646d2f7a726e696b2f6d6b73716c)[![Packagist Version](https://camo.githubusercontent.com/0cacf8289686262c60f847b8de722a962ce1b39016b9f1d17df540c2d55aec8c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a726e696b2f6d6b73716c)](https://camo.githubusercontent.com/0cacf8289686262c60f847b8de722a962ce1b39016b9f1d17df540c2d55aec8c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a726e696b2f6d6b73716c)

Do not use this!
================

[](#do-not-use-this)

Use doctrine instead!

### What is it?

[](#what-is-it)

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

**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](docs/index.md) file.

#### Requirements

[](#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

[](#installation)

`composer require zrnik/mksql`

Read more at [Installation and Configuration](docs/install-and-config.md) page.

#### Supported Drivers:

[](#supported-drivers)

- [✅ MySQL](https://www.mysql.com)
- [✅ SQLite 3](https://www.sqlite.org/index.html)

#### This package contains a [Tracy](https://tracy.nette.org/en/) panel

[](#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](https://nette.org/en/), register it in your configuration file:

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

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance53

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~19 days

Recently: every ~114 days

Total

50

Last Release

1190d ago

PHP version history (5 changes)0.1.0PHP &gt;=7.2.0

0.2.0PHP &gt;=7.1.0

0.4.0PHP &gt;=7.2

0.5.1PHP &gt;=7.4

v0.6.6PHP &gt;=8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/55077930?v=4)[Štěpán Zrník](/maintainers/zrnik)[@Zrnik](https://github.com/Zrnik)

---

Top Contributors

[![Zrnik](https://avatars.githubusercontent.com/u/55077930?v=4)](https://github.com/Zrnik "Zrnik (91 commits)")

---

Tags

dbalmysqlormphpsqlsql-tables-autoupdatersqlitetracy-panelmysqlsqlitesqltablecreate

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/zrnik-mksql/health.svg)

```
[![Health](https://phpackages.com/badges/zrnik-mksql/health.svg)](https://phpackages.com/packages/zrnik-mksql)
```

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[catfan/medoo

The lightweight PHP database framework to accelerate development

4.9k1.5M194](/packages/catfan-medoo)[cycle/orm

PHP DataMapper ORM and Data Modelling Engine

1.3k835.4k65](/packages/cycle-orm)[usmanhalalit/pixie

A lightweight, expressive, framework agnostic query builder for PHP.

6872.2M15](/packages/usmanhalalit-pixie)[aura/sqlquery

Object-oriented query builders for MySQL, Postgres, SQLite, and SQLServer; can be used with any database connection library.

4572.9M34](/packages/aura-sqlquery)[matthiasmullie/scrapbook

Scrapbook is a PHP cache library, with adapters for e.g. Memcached, Redis, Couchbase, APCu, SQL and additional capabilities (e.g. transactions, stampede protection) built on top.

3212.5M32](/packages/matthiasmullie-scrapbook)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
