aozisik/outport
Composer 安装命令:
composer require aozisik/outport
包简介
Exports Laravel Collections to a single SQLite database
README 文档
README
Just pass in Laravel collections and Outport will put them all in a SQLite database.
##How do I use it?
You should first require this package through composer:
composer require aozisik/outport
Note: For Laravel 4.2, see L4 branch.
Then simply:
use Aozisik\Outport\Outport;
$books = collect([
[
'title' => 'Pride and Prejudice',
'author' => 'Jane Austen'
],
[
'title' => 'Oliver Twist',
'author' => 'Charles Dickens'
],
[
'title' => 'The Fault in Our Stars',
'author' => 'John Green'
]
]);
$sqliteFile = (new Outport())
->table('books', $books, ['author']) // table name, collection, indexes
->go();
echo $sqliteFile; // Path to your sqlite database
##I want details!
Outport is a Laravel package that helps you create SQLite databases from arbitrary Laravel collections. Just pass in your collections and set your table names.
Outport will:
- Decide the best way to create tables for your collections
- Create a SQLite database and migrate those tables
- Insert data from your collection in chunks
- Create indexes if asked
A simple go() call will wrap it all together and spit out the path to your SQLite file, complete with the tables and indexes you want.
##Why would you want to output SQLite?
SQLite is a very compact format, therefore it is widely used inside mobile applications.
I have created this package to help facilitate data transportation between my Laravel back-end and SQLite enabled mobile app. So if you need to pre-populate fresh copies of your app and/or push updates to existing copies through your Laravel back-end, this package will help you do that.
Suggestions and pull requests are welcome!
aozisik/outport 适用场景与选型建议
aozisik/outport 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 23 次下载、GitHub Stars 达 3, 最近一次更新时间为 2016 年 11 月 05 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「collections」 「sqlite」 「export」 「laravel」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 aozisik/outport 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 aozisik/outport 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 aozisik/outport 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dibi is Database Abstraction Library for PHP
Bulk export of sylius resources
The tenancy/tenancy database driver for sqlite
This package provides type-safe extension of the laravel collection, forcing a single type of object.
Doctrine Collections adapter for Rekapager pagination library
Library to mimics generic collections
统计信息
- 总下载量: 23
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2016-11-05