承接 adachsoft/dynamic-table-in-memory 相关项目开发

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

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

adachsoft/dynamic-table-in-memory

Composer 安装命令:

composer require adachsoft/dynamic-table-in-memory

包简介

In-memory RAM implementation of adachsoft/dynamic-table-contract

README 文档

README

License

In-memory (RAM-based) implementation of the adachsoft/dynamic-table-contract package.

Provides complete CRUD for tables and rows, plus powerful querying capabilities (findBy()) with filtering, sorting, pagination, and column projection — all executed in memory without any external database.

Features

  • Fully implements TableRepositoryInterface and QueryableRowRepositoryInterface
  • Isolated in-memory store (no static state, multiple independent instances supported)
  • Efficient query engine with:
    • Complex filters (AND/OR/NOT, comparisons, LIKE, IN, null checks)
    • Multi-level sorting (ASC/DESC)
    • Pagination with accurate totalCount
    • Projection/aliasing with expressions (CONCAT, TEMPLATE, JSON_EXTRACT, literals)
  • Zero dependencies beyond the contract and PHP 8.2+
  • Testable and lightweight

Installation

Add to your composer.json (in monorepo setup):

{
    "repositories": [
        {
            "type": "path",
            "url": "packages/dynamic-table-in-memory"
        }
    ],
    "require": {
        "adachsoft/dynamic-table-in-memory": "*"
    }
}

Then run:

composer install

Usage

Basic Setup

use AdachSoft\DynamicTableInMemory\Store\InMemoryStore;
use AdachSoft\DynamicTableInMemory\Repository\InMemoryTableRepository;
use AdachSoft\DynamicTableInMemory\Repository\InMemoryRowRepository;
use AdachSoft\DynamicTableInMemory\Query\ExpressionEvaluator;
use AdachSoft\DynamicTableInMemory\Query\FilterEvaluator;
use AdachSoft\DynamicTableInMemory\Query\RowProjector;

// Create shared store
$store = new InMemoryStore();

// Repositories
$tableRepo = new InMemoryTableRepository($store);

$expressionEvaluator = new ExpressionEvaluator();
$filterEvaluator = new FilterEvaluator($expressionEvaluator);
$rowProjector = new RowProjector($expressionEvaluator);

$rowRepo = new InMemoryRowRepository(
    $store,
    $filterEvaluator,
    $expressionEvaluator,
    $rowProjector
);

Creating a Table

use AdachSoft\DynamicTableContract\Dto\NewTableDto;
use AdachSoft\DynamicTableContract\Dto\ColumnDto;
use AdachSoft\DynamicTableContract\Type\BuiltIn\StringType;
use AdachSoft\DynamicTableContract\Type\BuiltIn\IntType;

$columns = [
    new ColumnDto('id', new IntType()),
    new ColumnDto('name', new StringType()),
    new ColumnDto('email', new StringType()),
];

$table = $tableRepo->create(new NewTableDto('users', $columns));

Row Operations

use AdachSoft\DynamicTableContract\Dto\NewRowDto;

// Add row (auto ID)
$row = $rowRepo->add('users', null, new NewRowDto([
    'name' => 'John Doe',
    'email' => 'john@example.com',
]));

// Get by ID
$retrieved = $rowRepo->getById('users', $row->id);

// Update
$rowRepo->update('users', $row->id, new NewRowDto([
    'name' => 'Jane Doe',
    'email' => 'jane@example.com',
]));

// Delete
$rowRepo->delete('users', $row->id);

Advanced Querying with findBy()

use AdachSoft\DynamicTableContract\Query\Dto\QueryParametersDto;
use AdachSoft\DynamicTableContract\Query\Filter\EqualsCondition;
use AdachSoft\DynamicTableContract\Query\Filter\AndFilter;
use AdachSoft\DynamicTableContract\Query\Sort\SortVo;
use AdachSoft\DynamicTableContract\Query\Pagination\PaginationVo;
use AdachSoft\DynamicTableContract\Query\Expression\ConcatExpressionVo;

// Example filter: name LIKE '%doe%' AND email IS NOT NULL
$filter = new AndFilter([
    new LikeCondition::column('name', '%doe%'),
    new IsNotNullCondition::column('email'),
]);

// Sort by name ASC, then email DESC
$sorts = new SortCollection([
    SortVo::asc('name'),
    SortVo::desc('email'),
]);

// Pagination and projection
$params = new QueryParametersDto(
    filter: $filter,
    sorts: $sorts,
    pagination: new PaginationVo(page: 1, perPage: 10),
    selectedColumns: [
        'full_name' => new ConcatExpressionVo(['name', 'email'], ' - '),
        'email',
    ]
);

$result = $rowRepo->findBy('users', $params);

echo 'Total matching rows: ' . $result->totalCount . PHP_EOL;
foreach ($result->rows->all() as $row) {
    echo $row->values['full_name'] . PHP_EOL;
}

See the contract documentation for full details on DTOs, expressions, filters, and types.

Testing

Run tests with:

cd packages/dynamic-table-in-memory
composer install
vendor/bin/phpunit

Or from root:

vendor/bin/phpunit --testsuite=InMemory

(All functional tests for both repositories are included in tests/Functional/.)

License

MIT License - see LICENSE file.

Contributing

See the main monorepo CONTRIBUTING.md.

adachsoft/dynamic-table-in-memory 适用场景与选型建议

adachsoft/dynamic-table-in-memory 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

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

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

围绕 adachsoft/dynamic-table-in-memory 我们能提供哪些服务?
定制开发 / 二次开发

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

BUG 修复 & 性能优化

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

项目外包 & 长期维护

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

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

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-22