承接 byjg/anydataset-db 相关项目开发

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

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

byjg/anydataset-db

最新稳定版本:6.0.0

Composer 安装命令:

composer require byjg/anydataset-db

包简介

AnyDataset-DB provides a relational database abstraction layer. It is part of the Anydataset project, an agnostic data source abstraction layer for PHP.

README 文档

README

Sponsor Build Status Opensource ByJG GitHub source GitHub license GitHub release

AnyDataset-DB provides a relational database abstraction layer. It is part of the Anydataset project, an agnostic data source abstraction layer for PHP.

Learn more about Anydataset here.

Features

  • Connection based on URI
  • Handles compatibility and code optimization across multiple databases (e.g., MySQL, PostgreSQL, MS SQL Server)
  • Built-in Query Cache support using a PSR-16 compliant interface
  • Enables connection routing based on regular expressions for queries (e.g., directing queries to different databases for specific tables)

Connection Based on URI

Database connections are defined using URL-based connection strings.

Supported drivers are listed below:

Database Connection String Factory Method
SQLite sqlite:///path/to/file getDbInstance()
MySQL/MariaDB mysql://username:password@hostname:port/database getDbInstance()
PostgreSQL psql://username:password@hostname:port/database getDbInstance()
SQL Server (DbLib) dblib://username:password@hostname:port/database getDbInstance()
SQL Server (Sqlsrv) sqlsrv://username:password@hostname:port/database getDbInstance()
Oracle (OCI8) oci8://username:password@hostname:port/database getDbInstance()
Generic PDO pdo://username:password@pdo_driver?PDO_PARAMETERS getDbInstance()

Example usage:

<?php
$conn = \ByJG\AnyDataset\Db\Factory::getDbInstance("mysql://root:password@10.0.1.10/myschema");

Examples

Advanced Topics

Database Specifics

Install

Just type:

composer require "byjg/anydataset-db"

Dependencies

flowchart TD
    byjg/anydataset-db --> byjg/anydataset
    byjg/anydataset-db --> ext-pdo
    byjg/anydataset-db --> byjg/uri
    byjg/anydataset-db --> psr/cache
    byjg/anydataset-db --> psr/log
Loading

Open source ByJG

统计信息

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

GitHub 信息

  • Stars: 5
  • Watchers: 1
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 未知

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固