承接 webimage/app-db 相关项目开发

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

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

webimage/app-db

Composer 安装命令:

composer require webimage/app-db

包简介

README 文档

README

In configuration, setup the following structure

Connections

Set up named connections. Generally, use "default" as the connection name to allow any ConnectionManager::getConnection() call to work.

Settings are compatible with Doctrine's ConnectionManager, allowing you to use the same configuration for both.

[
    'database' => [
        'connections' => [
            'default|connectionName' => [ // Doctrine connection manager compatible
                'dbname'   => 'your_database_name',
                'user'     => 'your_username',
                'password' => 'your_password',
                'host'     => '127.0.0.1', // Optional
                'port'     => 3306, // Optional
                'driver'   => 'pdo_mysql'
            ]
        ]
    ]
]

Supported drivers include:

Driver Description Required PHP Extension
pdo_mysql MySQL / MariaDB using PDO pdo_mysql
mysqli MySQL / MariaDB using MySQLi driver mysqli
pdo_pgsql PostgreSQL using PDO pdo_pgsql
pdo_sqlite SQLite using PDO pdo_sqlite
pdo_sqlsrv Microsoft SQL Server using PDO pdo_sqlsrv
sqlsrv Microsoft SQL Server using native driver sqlsrv
oci8 Oracle using OCI8 oci8
pdo_oci Oracle using PDO pdo_oci
ibm_db2 IBM DB2 ibm_db2
pdo_ibm IBM DB2 using PDO pdo_ibm
pdo_firebird Firebird using PDO pdo_firebird
pdo_dblib SQL Server/Sybase via FreeTDS pdo_dblib

Global Table Prefix

Defining a global table prefix allows you to set a prefix that will be applied to all tables unless overridden by specific table settings.

[
    'database' => [
        'globalTablePrefix' => 'prefix_'
    ]
]

Table Settings

Simple table aliases can be set up as follows:

[
    'database' => [
        'tables' => [
            'tableAlias' => 'tableName'
        ]
    ]
]

Or more fine grain control can be achieved by specifying the table name, read and write connections, and whether to use the global prefix:

[
    'database' => [
        'tables' => [
            'tableAlias' => [
                'table' => 'tableName',
                'readConnection' => 'readConnectionName',
                'writeConnection' => 'writeConnectionName',
                'useGlobalPrefix' => true|false
            ] 
        ]
    ]
]

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2021-06-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固