rdb-php

授权协议 MIT License
开发语言 PHP
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 彭建业
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Async PHP migrations & seeds

Dead-simple PHP migrations controlled from code.

Features

  • Asynchronous migrations build with Amp.
  • Developed to use from code and cli.
  • Developed to use any database with these tool. Currently supported official Amp Postgres & MySQL clients.
  • You can extend console commands to use tool with your custom config definitions instead of always use --connect flag.
  • You can use migrations/seeds files from anywhere and with any paths.

Installation

Install tool:

composer require spacetab-io/rdb

and install database client, like this:

composer require amphp/postgres

Usage

use Spacetab\Rdb\Notifier\StdoutNotifier;
use Spacetab\Rdb\Rdb;
use Spacetab\Rdb\Driver;
use Amp\Postgres;
use Amp\Postgres\ConnectionConfig;

Amp\Loop::run(function () {
    $config = ConnectionConfig::fromString('host=localhost user=root dbname=test');
    /** @var Postgres\Pool $pool */
    $pool = Postgres\pool($config);

    $driver   = new Driver\SQL\Postgres($pool);
    $rdb      = new Rdb($driver, new StdoutNotifier()); // Optional. By default notifications is muted.
    $migrator = $rdb->getMigrator();

    yield $migrator->install();
    yield $migrator->migrate();
    yield $rdb->getSeeder()->run();
});

Usage from cli

vendor/bin/rdb list
Rdb – dead-simple async PHP migrations controlled from code. (v1.0).

Usage:
  command [options] [arguments]

Options:
  -h, --help            Display this help message
  -q, --quiet           Do not output any message
  -V, --version         Display this application version
      --ansi            Force ANSI output
      --no-ansi         Disable ANSI output
  -n, --no-interaction  Do not ask any interactive question
  -v|vv|vvv, --verbose  Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

Available commands:
  help             Displays help for a command
  list             Lists commands
 make
  make:migration   Create a new migration files
  make:seed        Create a new seeder file
 migrate
  migrate:down     [migrate:rollback] Rollback the last database migration
  migrate:install  Create the migration repository
  migrate:refresh  Reset and re-run all migrations
  migrate:reset    Rollback all database migrations
  migrate:status   Show the status of each migration
  migrate:up       Run the database migrations
 seed
  seed:run         Seed the database with records

Depends

  • >= PHP 7.4
  • Composer for install package

Tests

  • Unit vendor/bin/phpunit --testsuite Unit
  • Integration vendor/bin/phpunit --testsuite Integration. Accept ENV's: PHPUNIT_RDB_PG_HOST, PHPUNIT_RDB_PG_PORT,PHPUNIT_RDB_PG_DBNAME, PHPUNIT_RDB_PG_USER, PHPUNIT_RDB_PG_PWD

License

The MIT License

Copyright © 2020 spacetab.io, Inc. https://spacetab.io

Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software isfurnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE.

  •  redis-rdb-tools是由Python写的用来分析Redis的rdb快照文件用的工具,它可以把rdb快照文件生成json文件或者生成报表用来分析Redis的使用详情、使用标准的diff工具比较两个dump文件,总之是比较实用的工具,至于安装可以通过Python的pip来安装 [root@localhost ~]# yum -y install python-pip python-redi

  • 硬件PCB板重新设计,SATA控制器SIL 3132在原来的设计里,通过一个pci-e switch下挂在PCIE2。现在的设计去除了PCI-E switch,将sata控制器字直接连接到PCIE1。 PCB板贴片完成后,开始硬件调试。 首先是烧录U-BOOT,发现下面的启动信息: U-Boot 2013.01 (Nov 19 2013 - 14:12:53) CPU0: P2020E, Ve

  • Redis 的数据是存储在内存当中, 因为服务器宕机、停电等情况, Redis 中的数据容易丢失。这时 Redis 持久化的作用就体现出来了。例: 可以用来完成数据恢复、故障恢复数据等。 Redis 持久化分为三种策略机制: RDB(Redis DataBase)、 AOF(Append Only File)、两种方式混合持久化。 本文简要的描述两种方式。 如需深层次的知识点, 恭请各位大佬进入高

  • RDB 详解 rdb是redis 默认的持久化方案。在指定的时间间隔内,执行指定次数的写操作,则会将内存中的数据写入到磁盘中。即在指定目录下生成一个dump.rdb文件。Redis 重启会通过加载dump.rdb文件恢复数据。 1.rdb 核心规则配置 save 900 1 save 300 10 save 60 10000 解说:save <指定时间间隔> <执行指定次数更新操作>,满足条件就将

 相关资料
  • RDB

    在运行情况下, Redis 以数据结构的形式将数据维持在内存中, 为了让这些数据在 Redis 重启之后仍然可用, Redis 分别提供了 RDB 和 AOF 两种持久化模式。 在 Redis 运行时, RDB 程序将当前内存中的数据库快照保存到磁盘文件中, 在 Redis 重启动时, RDB 程序可以通过载入 RDB 文件来还原数据库的状态。 RDB 功能最核心的是 rdbSave 和 rdbL

  • rdb

    rdb 是 Node.js 的一个 ORM 框架,支持 Postgres 和 MySQL 数据库。 特点: 简单灵活的映射器 支持事务处理 可定制的持久化策略 支持延迟加载 基于 promises. 示例代码: var rdb = require('rdb');var Customer = rdb.table('_customer');Customer.primaryColumn('cId').g

  • 背景 canal 1.1.1版本之后, 内置增加客户端数据同步功能, Client适配器整体介绍: [[ClientAdapter]] RDB适配器 RDB adapter 用于适配mysql到任意关系型数据库(需支持jdbc)的数据同步及导入 测试支持的数据库列表: MySQL Oracle Postgress SQLServer ... 1 修改启动器配置: application.yml,

  • java-redis-rdb 是一个用来解析 Redis 的 dump.rdb 文件的 Java 开发包。

  • Redis rdb CLI 是一种可以解析、过滤、拆分、合并 rdb 并离线分析内存使用情况的工具。 运行时依赖 jdk 1.8+ 安装 wget https://github.com/leonchen83/redis-cli-tool/releases/download/v0.1.3/redis-cli-tool.zipunzip redis-cli-tool.zipsudo chmod -R 

  • 主要内容:RDB快照模式原理,RDB持久化触发策略,RDB持久化优劣势Redis 是一款基于内存的非关系型数据库,它会将数据全部存储在内存中。但是如果 Redis 服务器出现某些意外情况,比如宕机或者断电等,那么内存中的数据就会全部丢失。因此必须有一种机制能够保证 Redis 储存的数据不会因故障而丢失,这就是 Redis 的数据持久化机制。 数据的持久化存储是 Redis 的重要特性之一,它能够将内存中的数据保存到本地磁盘中,实现对数据的持久存储。这样即使在服务器