PHPackages                             selcukmart/migration2sqlbuilder - 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. selcukmart/migration2sqlbuilder

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

selcukmart/migration2sqlbuilder
===============================

This library is for migration natural sql to sql builder format. It supports only first depth and general usage of sql.

1.0.0(4y ago)03MITPHPPHP ^7.1 || ^8.0

Since Feb 1Pushed 4y ago1 watchersCompare

[ Source](https://github.com/selcukmart/Migration2SQLBuilder)[ Packagist](https://packagist.org/packages/selcukmart/migration2sqlbuilder)[ RSS](/packages/selcukmart-migration2sqlbuilder/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

\#Migration to SQLBuilder This library is for migration natural sql to sql builder format. It supports only first depth and general usage of sql.

```
composer require selcukmart/migration2sqlbuilder

```

USAGE
-----

[](#usage)

```
$sql = "SELECT * FROM A ";
$migration = new Migration2SQLBuilder();
$output = $migration->sqlBuilder($sql);
```

### Example

[](#example)

```
SELECT
    a,
       b,
       c.s,
  gg.*,
  so.sube_id,
  so.ana_yetki_id,
  so.ad AS KUL_AD,
  so.soyad AS KUL_SOYAD,
  os.isim ODEME_SECENEKLERI,
  nes2.isim AS KARGO_FIRMASI,
  ei.id AS INVOICE_ID,
  ei.parasut_fatura_id,
  ei.e_fatura_or_arsiv,
  ei.parasut_e_fatura_id,
  ei.trackable_job_id,
  ei.status,
  ei.proccess_status,
  ei.sent,
  ei.pdf_url,
  ei.kargo_gonderildi,
  ei.kargo_firmasina_bildirildi,
  ei.bildirim_tarihi
FROM
  tes_gelir_gider AS gg
      LEFT JOIN tes_nesne AS nes2 ON nes2.id = gg.kargo_firma_id
  AND nes2.tip = '15' AND nes2.isim='12ssd' XOR nes2.ad='sdsdsd' && (nes2.k='12' || nes2.k='sdsd')
  INNER JOIN tes_kullanici so ON so.id = gg.kisi_id
  LEFT JOIN tes_odeme_secenekleri os ON os.id = gg.odeme_secenekleri

  LEFT JOIN tes_adresler adr ON adr.id = gg.teslimat_adresi_id
  LEFT JOIN tes_adresler adr2 ON adr2.id = gg.fatura_adresi_id
  LEFT JOIN tes_il_ilce_semt_mahalle iism1 ON iism1.id = adr.il
  AND iism1.kume_id = '0'
  LEFT JOIN tes_il_ilce_semt_mahalle iism5 ON iism5.id = adr2.il
  AND iism5.kume_id = '0'
  LEFT JOIN tes_e_invoice ei ON ei.gg_id = gg.id
WHERE
  gg.durum  Array
        (
            [type] => SELECT
            [0] => a
            [1] => b
            [c] => Array
                (
                    [0] => s
                )

            [gg] => Array
                (
                    [0] => *
                )

            [so] => Array
                (
                    [0] => sube_id
                    [1] => ana_yetki_id
                    [2] => ad AS KUL_AD
                    [3] => soyad AS KUL_SOYAD
                )

            [os] => Array
                (
                    [0] => isim ODEME_SECENEKLERI
                )

            [nes2] => Array
                (
                    [0] => isim AS KARGO_FIRMASI
                )

            [ei] => Array
                (
                    [0] => id AS INVOICE_ID
                    [1] => parasut_fatura_id
                    [2] => e_fatura_or_arsiv
                    [3] => parasut_e_fatura_id
                    [4] => trackable_job_id
                    [5] => status
                    [6] => proccess_status
                    [7] => sent
                    [8] => pdf_url
                    [9] => kargo_gonderildi
                    [10] => kargo_firmasina_bildirildi
                    [11] => bildirim_tarihi
                )

        )

    [2] => Array
        (
            [type] => FROM
            [0] => tes_gelir_gider
            [1] => AS
            [2] => gg
        )

    [3] => Array
        (
            [type] => LEFT JOIN
            [table] => Array
                (
                    [0] => tes_nesne
                    [1] => AS
                    [2] => nes2
                )

            [ON] => Array
                (
                    [nes2] => id
                    [gg] => kargo_firma_id
                )

            [WHERE] =>  AND nes2.tip = 15 AND nes2.isim = 12ssd XOR nes2.ad = sdsdsd && ( nes2.k = 12 || nes2.k = sdsd )
        )

    [4] => Array
        (
            [type] => INNER JOIN
            [table] => Array
                (
                    [0] => tes_kullanici
                    [1] => so
                )

            [ON] => Array
                (
                    [so] => id
                    [gg] => kisi_id
                )

        )

    [5] => Array
        (
            [type] => LEFT JOIN
            [table] => Array
                (
                    [0] => tes_odeme_secenekleri
                    [1] => os
                )

            [ON] => Array
                (
                    [os] => id
                    [gg] => odeme_secenekleri
                )

        )

    [6] => Array
        (
            [type] => LEFT JOIN
            [table] => Array
                (
                    [0] => tes_adresler
                    [1] => adr
                )

            [ON] => Array
                (
                    [adr] => id
                    [gg] => teslimat_adresi_id
                )

        )

    [7] => Array
        (
            [type] => LEFT JOIN
            [table] => Array
                (
                    [0] => tes_adresler
                    [1] => adr2
                )

            [ON] => Array
                (
                    [adr2] => id
                    [gg] => fatura_adresi_id
                )

        )

    [8] => Array
        (
            [type] => LEFT JOIN
            [table] => Array
                (
                    [0] => tes_il_ilce_semt_mahalle
                    [1] => iism1
                )

            [ON] => Array
                (
                    [iism1] => id
                    [adr] => il
                )

            [WHERE] =>  AND iism1.kume_id = 0
        )

    [9] => Array
        (
            [type] => LEFT JOIN
            [table] => Array
                (
                    [0] => tes_il_ilce_semt_mahalle
                    [1] => iism5
                )

            [ON] => Array
                (
                    [iism5] => id
                    [adr2] => il
                )

            [WHERE] =>  AND iism5.kume_id = 0
        )

    [10] => Array
        (
            [type] => LEFT JOIN
            [table] => Array
                (
                    [0] => tes_e_invoice
                    [1] => ei
                )

            [ON] => Array
                (
                    [ei] => gg_id
                    [gg] => id
                )

        )

    [11] => Array
        (
            [type] => WHERE
            [WHERE] =>  gg.durum < 4 AND ei.status BETWEEN 1 AND 10 AND ei.status NOT BETWEEN 4 AND 6 ( XOR os.durum = 1 ) OR so.ad = asdasdasd
        )

    [12] => Array
        (
            [type] => GROUP BY
            [a] => Array
                (
                    [0] => sira
                )

            [b] => Array
                (
                    [0] => c
                )

            [d] => Array
                (
                    [0] => e
                )

        )

    [13] => Array
        (
            [type] => ORDER BY
            [az] => Array
                (
                    [0] => sira
                )

            [c] => Array
                (
                    [0] => x
                )

        )

    [14] => Array
        (
            [type] => LIMIT
            [0] => 10, 15
        )

)
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1613d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8598667?v=4)[SELÇUK MART](/maintainers/selcukmart)[@selcukmart](https://github.com/selcukmart)

---

Top Contributors

[![selcukmart](https://avatars.githubusercontent.com/u/8598667?v=4)](https://github.com/selcukmart "selcukmart (2 commits)")

### Embed Badge

![Health badge](/badges/selcukmart-migration2sqlbuilder/health.svg)

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

###  Alternatives

[pestphp/pest

The elegant PHP Testing Framework.

11.6k72.2M20.5k](/packages/pestphp-pest)[ahmed-bhs/doctrine-doctor

Runtime analysis tool for Doctrine ORM integrated into Symfony Web Profiler. Unlike static linters, it analyzes actual query execution at runtime to detect performance bottlenecks, security vulnerabilities, and best practice violations during development with real execution context and data.

9410.7k](/packages/ahmed-bhs-doctrine-doctor)[cakephp/bake

Bake plugin for CakePHP

11212.0M202](/packages/cakephp-bake)[dereuromark/cakephp-queue

The Queue plugin for CakePHP provides deferred task execution.

308954.9k25](/packages/dereuromark-cakephp-queue)[drupal/core-dev

require-dev dependencies from drupal/drupal; use in addition to drupal/core-recommended to run tests from drupal/core.

2022.6M343](/packages/drupal-core-dev)[fleetbase/core-api

Core Framework and Resources for Fleetbase API

1235.9k20](/packages/fleetbase-core-api)

PHPackages © 2026

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