querytechnology/tqc
Composer 安装命令:
composer require querytechnology/tqc
包简介
Command line interface for the TinyQueries Compiler
README 文档
README
Command line interface written in PHP for the TinyQueries™ Compiler
Installation
- Make sure you have an API key for the TinyQueries™ Compiler. You can get one here: https://tinyqueries.com/signup. You can choose to add
TINYQUERIES_API_KEYto your ENV variables OR add it to the.envfile of your project if you have one. - Make sure you have PHP v7.0 or higher
- For Windows download the files
bin/tqc.pharandbin/tqc.batfrom this repo and put them in a folder which is in your PATH - For Mac/Linux run these commands:
wget https://github.com/querytechnology/tqc-php/raw/master/bin/tqc.phar sudo mv tqc.phar /usr/local/bin/tqc sudo chmod +x /usr/local/bin/tqc
Setup TinyQueries™ for your project
It is assumed you have a folder for your project. It can be an empty folder or a folder which contains other code as well.
- Create a folder inside your project folder (for example
tinyqueries) in which you put your TinyQueries source queries - Create a folder inside your project folder (for example
sql) in which you want the compiler to put your compiled queries - Create a config file
tinyqueries.jsonortinyqueries.yamlin the root of your project folder. For example:
project: label: your-project-label compiler: dialect: mysql input: ./tinyqueries output: ./sql
For a more detailed description of config files please check https://compile.tinyqueries.com
Compile your queries
Once you have setup your project you just have to execute
tqc
from your project folder each time you want to compile your source files
Use the lib as PHP package
If you want to call the TinyQueries™ Compiler from inside a PHP script, instead of from the command line, you can do that as follows:
composer require querytechnology/tqc
Example PHP file how to compile your queries:
<?php require_once './vendor/autoload.php'; use TinyQueries\Compiler; $compiler = new Compiler(); $apiKey = 'your-api-key'; $config = [ 'project' => [ 'label' => 'your-project-label' ], 'compiler' => [ 'dialect' => 'mysql', 'input' => './tinyqueries', 'output' => './sql' ] ]; $compiler->compile($config, $apiKey);
querytechnology/tqc 适用场景与选型建议
querytechnology/tqc 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 8 次下载、GitHub Stars 达 1, 最近一次更新时间为 2020 年 05 月 08 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 querytechnology/tqc 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 querytechnology/tqc 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 8
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-05-08