PHPackages                             firevel/mysql-to-spanner - 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. firevel/mysql-to-spanner

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

firevel/mysql-to-spanner
========================

Laravel tool to convert MySQL schemas to Cloud Spanner Data Definition Language (DDL)

0.1.2(4y ago)1154MITPHPPHP ^7.2|^8.0

Since Aug 18Pushed 4y ago1 watchersCompare

[ Source](https://github.com/firevel/mysql-to-spanner)[ Packagist](https://packagist.org/packages/firevel/mysql-to-spanner)[ RSS](/packages/firevel-mysql-to-spanner/feed)WikiDiscussions master Synced yesterday

READMEChangelog (6)Dependencies (10)Versions (7)Used By (0)

Laravel tool to convert MySQL schemas to Cloud Spanner Data Definition Language (DDL)
=====================================================================================

[](#laravel-tool-to-convert-mysql-schemas-to-cloud-spanner-data-definition-language-ddl)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e65f685feca27264a38fe350612baac27b8bbdf3f38511fc4bd0629e61906668/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6669726576656c2f6d7973716c2d746f2d7370616e6e65722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/firevel/mysql-to-spanner)

Migrating from MySQL to Cloud Spanner
-------------------------------------

[](#migrating-from-mysql-to-cloud-spanner)

Start here: [Migrating from MySQL to Cloud Spanner](https://cloud.google.com/architecture/migrating-mysql-to-spanner).

Make sure that:

- All tables got primary keys.
- `AUTO_INCREMENT` can be ignored (not supported by Cloud Spanner).

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require firevel/mysql-to-spanner
```

Usage
-----

[](#usage)

### MySQL dump

[](#mysql-dump)

You can dump your MySQL database using command:

```
php artisan db:spanner-dump
```

Parameters supported:

- Use `--connection` to specify source (MySQL) connection name.
- Use `--file` to specify output ex.: `php artisan db:spanner-dump --file=storage/spanner-ddl.txt`.
- Use `--disk` together with `--file` to save output in storage defined in `/config/filesystems.php`, ex.: `php artisan db:spanner-dump --disk=gcs --file=exports/spanner-ddl.txt`.
- Use `--ignore-table` to specify tables to ignore during dump, ex: `php artisan db:spanner-dump --ignore-table=password_resets`, `php artisan db:spanner-dump --ignore-table=tmp_*`, `php artisan db:spanner-dump --ignore-table=table1,table2`.
- Use `--default-primary-key` to specify default primary key ex.: `php artisan db:spanner-dump --default-primary-key=id`.
- Use `--only` to specify tables to export ex.: `php artisan db:spanner-dump --only=table1,table2`.

### MySQL to Spanner migration

[](#mysql-to-spanner-migration)

You can migrate your MySQL data to Spanner using command:

```
php artisan db:spanner-migrate
```

By default only schema will be migrated, if you would like to migrate schema and data run:

```
php artisan db:spanner-migrate --data
```

Parameters supported:

- Use `--connection` to specify source (MySQL) connection name.
- Use `--spanner-connection` to specify connection name (`spanner` by default).
- Use `--fresh` to delete database before creating schemas.
- Use `--data` to migrate rows.
- Use `--chunk-size` to specify chunk size used in data migration.
- Use `--schema=false` to skip schema migration.
- Use `--ignore-table` to specify tables to ignore during dump, ex: `php artisan db:spanner-dump --ignore-table=password_resets`, `php artisan db:spanner-dump --ignore-table=tmp_*`, `php artisan db:spanner-dump --ignore-table=table1,table2`.
- Use `--default-primary-key` to specify default primary key ex.: `php artisan db:spanner-dump --default-primary-key=id`.
- Use `--only` to specify tables to export ex.: `php artisan db:spanner-dump --only=table1,table2`.

Credits
-------

[](#credits)

- [Michael Slowik](https://github.com/sl0wik)
- [Miguel Costa](https://github.com/mgcostaParedes)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.1% 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

Total

6

Last Release

1631d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3ef4a79c6f9a9afe04267a19b98fe0a5a45930c92d08fd720b233ab21ae102ca?d=identicon)[sl0wik](/maintainers/sl0wik)

---

Top Contributors

[![sl0wik](https://avatars.githubusercontent.com/u/2696038?v=4)](https://github.com/sl0wik "sl0wik (52 commits)")[![mgcostaParedes](https://avatars.githubusercontent.com/u/16031444?v=4)](https://github.com/mgcostaParedes "mgcostaParedes (1 commits)")

---

Tags

laravelmysqlspannergcpddlfireveldata definition languagegoogle cloud spanner

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/firevel-mysql-to-spanner/health.svg)

```
[![Health](https://phpackages.com/badges/firevel-mysql-to-spanner/health.svg)](https://phpackages.com/packages/firevel-mysql-to-spanner)
```

###  Alternatives

[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k25.2M34](/packages/kirschbaum-development-eloquent-power-joins)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[watson/validating

Eloquent model validating trait.

9723.3M47](/packages/watson-validating)[dyrynda/laravel-model-uuid

This package allows you to easily work with UUIDs in your Laravel models.

4802.8M8](/packages/dyrynda-laravel-model-uuid)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)

PHPackages © 2026

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