承接 graze/sprout 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

graze/sprout

Composer 安装命令:

composer require graze/sprout

包简介

Seed data for your project

README 文档

README

Latest Version on Packagist Software License CI PHP Version Docker Image Size Docker Pulls

Sprout is a tool to help Dump, Truncate and Seed development data into your databases.

fun image

  1. Seed sql data from local files
  2. Dump data from mysql tables
  3. Performs actions in parallel
  4. Handle multiple groups of seed data (for example, static, core, testing)

Install

Via Composer

composer require graze/sprout

Via docker

docker run -v [volumes] --rm graze/sprout [command]

Usage

See the full documentation for complete usage information.

File Structure

Sprout will use the following file structure by default, you can change the root and each group's path in the configuration file.

- /seed
  - group1
    - schema1
      - table1.sql
      - table2.sql
    - schema2
      - table3.sql
  - group1
    - schema3
      - table4.sql

Quick Start

# Dump all tables you are interested in
sprout dump --config=config/sprout.yml --group=static a_schema:table_1,table_2 ...

# Store the data in your repository of choice
git add /seed/static/*

# Seed the data from your local files
sprout seed --config=config/sprout.yml --group=static

Seeding

sprout seed [--config=<path>] [--group=<group>] [--no-chop|--chop-all] [<schema>[:<table>,...]] ...

sprout seed --config=config/sprout.yml the_schema
sprout seed --config=config/sprout.yml --chop-all the_schema
sprout seed --config=config/sprout.yml --no-chop the_schema

sprout seed --config=config/sprout.yml the_schema:country
sprout seed --config=config/sprout.yml --no-chop the_schema:country other_schema:planets

sprout seed --config=config/sprout.yml --group=core
sprout seed --config=config/sprout.yml --group=core the_schema
sprout seed --config=config/sprout.yml --no-chop --group=extra
sprout seed --config=config/sprout.yml --chop-all --group=extra

Truncating the data from all the tables in a schema

sprout chop [--config=<path>] [--group=<group>] [--all] [<schema>[:<table>,...]] ...

sprout chop --config=config/sprout.yml the_schema
sprout chop --config=config/sprout.yml the_schema:country
sprout chop --config=config/sprout.yml --all the_schema

sprout chop --config=config/sprout.yml --group=core the_schema
sprout chop --config=config/sprout.yml --group=extra the_schema:country
sprout chop --config=config/sprout.yml --group=extra --all

Dumping the data from all tables in a schema

sprout dump [--config=<path>] [--group=<group>] [<schema>[:<table>,...]] ...

sprout dump --config=config/sprout.yml the_schema
sprout dump --config=config/sprout.yml the_schema:country

sprout dump --config=config/sprout.yml --group=core
sprout dump --config=config/sprout.yml --group=core the_schema:country

Configuration

The configuration file follows the following standards.

By default sprout looks for a config/sprout.yml file, you can specify a different file using --config=path/to/file.yml.

defaults:
  group: core
  # default path
  path: /seed
  # number of simultaneous processors to run at a time (default: 10)
  simultaneousProcesses: 10

# ability to specify custom paths for groups
groups:
  core:
    path: /custom/path/to/group

schemas:
  # name of the schema to reference
  <name>:
    # [optional] the actual name of the schema in the database. If not specified, <name> from above will be used
    schema: 'schema'

    # Connection details - this is just an example, you may want to specify
    # different properties, e.g. if connecting to a remote server. You are
    # advised to refer to the 'pdo' documentation for further details.
    connection:
      user: 'morphism'
      password: 'morphism'
      # driver for the database connection, currently only: `mysql` is supported
      driver: 'mysql'
      # [optional] name of the database
      dbName: 'schema'
      # database on a remote host
      host: 'db'
      # [optional] port to use, by default: 3306
      port: 3306

Testing

make build test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email security@graze.com instead of using the issue tracker.

Credits

License

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

graze/sprout 适用场景与选型建议

graze/sprout 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8 次下载、GitHub Stars 达 0, 最近一次更新时间为 2018 年 08 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「database」 「graze」 「database seeder」 「sprout」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 graze/sprout 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 graze/sprout 我们能提供哪些服务?
定制开发 / 二次开发

基于 graze/sprout 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 5
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 12
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-08-09