Download the PHP package marekpetras/yii2-merge-table without Composer

On this page you can find all versions of the php package marekpetras/yii2-merge-table. 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 yii2-merge-table

yii2-merge-table

Yii2 Merge Table

About

This trait allows you to split up a large dataset into multiple, more manageable smaller datasets (MyISAM) using MySQL and the MERGE engine

The idea is to have create a model table which is always empty and the trait then manages all other datasets.

We had the issue of having loads of data that we usually needed to access only by parts, and only very rarely aggregated.

So lets say you have a lots of accounts in the database and you need to give access to your users only to their own accounts but you also need to give overall access to the manager/admin.

If you have milions and milions of rows in the database but only access bits, you always have a few options how to scale your data, you can either replicate, partiotionate, use primary keys/indexes etc.

Another option is to use more identical tables and query only those actually required. If you have a common denominator that you can use (account id, customer id, date ranges etc) and by which you can select appropriate tables its really easy to manage.

You end up with a few tables based on your denominators e.g.:

Installation

The preferred way to install this extension is through composer.

Either run

or add

to the require section of your composer.json file.

Usage

Create the model class with which you will work pretty much the same way as with any other model class, the only thing you need to add is the defaultTableName() static function, whatever you specify here, the merge table will be called this in your database, the trait will create it by itself.

You need to come up with some sort of logical way to split your data. It could be account id, client id, yearmonth, or anything that will allow you to work with partial data if you need to. I usually just load the data (lot of it - milions of rows) from file.

Before you start to insert data, make sure the desired table exists, and if not the trait will create it.

Then if you want to access this data, you have to set which table you want to access (if you do not specify anything, the merge table will be queried)

There are a few ways to access the data, for example you might want to aggregate data from a few of those. Just send an array of the ids to the model first. The trait will create a temporary merge table which you can then query. It will be dropped at the

You will only ever query the whole merge table if you choose to do so, and if you do set a table name.

You can use the query as any other, in your data providers etc.


All versions of yii2-merge-table with dependencies

PHP Build Version
Package Version
Requires yiisoft/yii2 Version *
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 marekpetras/yii2-merge-table contains the following files

Loading the files please wait ....