phico / database
Phico的轻量级数据库支持
dev-main
2024-09-19 16:34 UTC
Requires
- php: ^8.0
- ext-pdo: *
- phico/cli: dev-main
- phico/config: dev-main
- phico/filesystem: dev-main
Requires (Dev)
- pestphp/pest: ^2.34
- phpstan/phpstan: *
This package is auto-updated.
Last update: 2024-09-19 16:34:48 UTC
README
定义并修改数据库表和索引的结构。
支持MySQL、MariaDB、PostgreSQL和SQLite方言。
安装
使用composer
composer require phico/schema
使用方法
创建表
使用create()
方法创建表
table()->create('table_name'); // use ifNotExists() if needed table()->create('table_name')->ifNotExists();
修改表
使用alter()
方法修改表
table()->alter('table_name');
索引
贡献
Schema已考虑为功能完善,但如果你发现任何关于其行为或性能的bug或问题,请创建一个问题,如果你有能力,提交一个修复的pull request将会很有帮助。
请确保根据需要更新测试。
对于重大更改,请首先打开一个问题以讨论你想要更改的内容。