All Projects â†’ dmstr â†’ yii2-db

dmstr / yii2-db

Licence: other
Database extensions for Yii 2.0 Framework 📦

Programming Languages

PHP
23972 projects - #3 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to yii2-db

behavior-trait
Allows handling events via inline declared methods, which can be added by traits
Stars: ✭ 18 (-5.26%)
Mutual labels:  behavior, yii2, trait
Yii2 Taggable Behavior
This extension allows you to get functional for tagging.
Stars: ✭ 83 (+336.84%)
Mutual labels:  behavior, yii2
Doctrinebehaviors
Doctrine2 behavior traits
Stars: ✭ 782 (+4015.79%)
Mutual labels:  behavior, trait
yii2-render-many
Trait for Yii Framework 2
Stars: ✭ 14 (-26.32%)
Mutual labels:  yii2, trait
Yii2 Save Relations Behavior
Validate and save automatically related Active Record models.
Stars: ✭ 125 (+557.89%)
Mutual labels:  behavior, yii2
yii2-linkable-behavior
Yii2 behavior to help creating urls easier
Stars: ✭ 12 (-36.84%)
Mutual labels:  behavior, yii2
menapro
CMS of 2017
Stars: ✭ 20 (+5.26%)
Mutual labels:  yii2
userstamps
A simple package to insert and load userstamps for a model automatically, it provides an eloquent trait to use in models..
Stars: ✭ 34 (+78.95%)
Mutual labels:  trait
yii2-highcharts-widget
HighCharts Js Widget for Yii2
Stars: ✭ 40 (+110.53%)
Mutual labels:  yii2
yii2-docker-app-advanced
Yii 2 Advanced Project Template under docker and docker-compose
Stars: ✭ 25 (+31.58%)
Mutual labels:  yii2
yii2-ajaxform
submit ActiveForm via ajax
Stars: ✭ 20 (+5.26%)
Mutual labels:  yii2
api
CashWarden API
Stars: ✭ 34 (+78.95%)
Mutual labels:  yii2
yii2-cookiemonster
Yii extension to manage cookie warning
Stars: ✭ 16 (-15.79%)
Mutual labels:  yii2
yii2-ledap
yii2 for ledap
Stars: ✭ 20 (+5.26%)
Mutual labels:  yii2
yii2-tinymce
Yii2 extension, tinymce wysiwyg editor
Stars: ✭ 16 (-15.79%)
Mutual labels:  yii2
NestedScrollingDemo
😋😋😋A good app for understanding android nested scrolling
Stars: ✭ 98 (+415.79%)
Mutual labels:  behavior
yii2-dynamic-fields
Widget for display dynamic fields, adding and removing their using Pjax.
Stars: ✭ 52 (+173.68%)
Mutual labels:  yii2
yii2-behaviors
Collection of useful behaviors for Yii Framework 2.0
Stars: ✭ 25 (+31.58%)
Mutual labels:  yii2
access-controller
A highly scalable open-source implementation of an access-control engine inspired by Google Zanzibar-"Google’s Consistent, Global Authorization System"
Stars: ✭ 61 (+221.05%)
Mutual labels:  access-control
yii2-merit
Reputation engine for Yii2 用于实现积分,等级功能的设计
Stars: ✭ 16 (-15.79%)
Mutual labels:  yii2

Yii 2 Database Toolkit

Latest Stable Version Total Downloads License

About

dmstr\db\behaviors\HydratedAttributes

Retrieves all eager loaded attributes of a model including relations. Once the extension is installed, simply use it in your code by accessing the corresponding classes by their full namespaced path.

dmstr\db\mysql\FileMigration

runs database migrations from sql files

Installation

The preferred way to install this extension is through composer.

Either run

composer require --prefer-dist dmstr/yii2-db "*"

or add

"dmstr/yii2-db": "*"

to the require section of your composer.json file.

Configuration

dmstr\console\controllers

Include it in your console configuration

   'controllerMap' => [
        'db'         => [
            'class' => 'dmstr\console\controllers\MysqlController',
            'noDataTables' => [
                'app_log',
                'app_session',
            ]
        ],
    ],

Usage

Commands

yii migrate ...

Create a file migration class

yii migrate/create \
    --templateFile='@vendor/dmstr/yii2-db/db/mysql/templates/file-migration.php' init_dump

yii db ...

DESCRIPTION

MySQL database maintenance command for current (db) connection


SUB-COMMANDS

- db/create               Create schema
- db/destroy              Remove schema
- db/dump                 Dump schema (all tables)
- db/export               Export tables (INSERT only)
- db/import               Import from file to database and flush cache
- db/index (default)      Displays tables in database
- db/wait-for-connection

To see the detailed information about individual sub-commands, enter:

  yii help <sub-command>

Show help

yii help db

Examples

Dry-run command (not available for all commands)

yii db/create root secret -n

Destroy database

yii db/destroy root secret

Dump all tables

yii db/dump -o /dumps

Dump from different connection, exclude logging tables

yii db/dump -o /dumps \
  --db=dbReadonly \
  --noDataTables=app_audit_data,app_audit_entry,app_audit_error,app_audit_javascript,app_audit_mail

Dump from secondary connection, import into primary (default)

yii db/dump -o /dumps   \
    --db=dbReadonly   \
    --noDataTables=app_audit_data,app_audit_entry,app_audit_error,app_audit_javascript,app_audit_mail \
 | xargs yii db/import --interactive=0

Built by dmstr

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].