Download the PHP package mgcosta/mysql-to-cloud-spanner without Composer

On this page you can find all versions of the php package mgcosta/mysql-to-cloud-spanner. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package mysql-to-cloud-spanner

MySQL to Google Cloud Spanner Migration Tool for PHP

License Actions Status codecov Total Downloads

The MySQL Parser to Google Cloud Spanner is a library for PHP, providing an easy way to migrate the data from MySQL to Google Cloud Spanner.

Install

Via Composer

Usage Instructions

To use this toolkit, you will need an array of the columns from MySQL and the respective foreign keys / indexes.

The table array you can use the Describe from MySQL, the foreign keys you will need to do something like that.

The library outputs a multidimensional array with following keys 'tables', 'indexes', 'constraints' to insert on the Google Cloud Spanner engine.

Note: You may want to store the constraint keys to run at the end of all tables and indexes to prevent running a constraint for a table which is not created.

Returning DDL statements without semicolons

If for some reason you need each statement without semicolon at the end, you can use the method shouldAssignPrimaryKey:

Dealing with schemas without Primary Keys

Since the primary key on cloud spanner is like almost required, by default if there's a table schema without PK it will generate a default column called by id which will be an int64 type. However you can modify the way this default column is created or disable it at all, for that check the following example:

Using the Dialect Service for MySQL

To help your life to fetch the data we need from MySQL to create the spanner statements, you can use the available service on your PDO or ORM / Query Builder:

This will simply generate a valid query string which you can use to fetch the columns & keys details.

The example below is Laravel based, but you can adapt it easily.

Prepare the data for migration

Sometimes you may have unexpected typed values to insert to Cloud Spanner, when you fetch the data from PHP PDOs system's, for that you can use the available transformer, which will prepare the data mapped with the described table.

For that follow the example below:

Roadmap

You can get more details of the plans for this early version on the following link.

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of mysql-to-cloud-spanner with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3 || ^8.0
ext-json Version *
ext-grpc Version *
google/cloud-spanner Version ^1.44.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mgcosta/mysql-to-cloud-spanner contains the following files

Loading the files please wait ....