dabl/适配器

DABL 数据库适配器

v1.2.1 2017-04-16 16:22 UTC

This package is auto-updated.

Last update: 2024-09-04 09:23:59 UTC


README

Build Status

DABL 适配器

PHP PDO 的各种 SQL 语言的子类

示例

代码

use Dabl\Adapter\DABLPDO;

// get connection (parameters usually come from .ini file)
$pdo = DABLPDO::connect(array(
    'driver' => 'mysql',
    'host' => 'localhost',
    'dbname' => 'test',
    'user' => 'root',
    'password' => ''
));

// Get database schema
$schema = $pdo->getDatabaseSchema();
$tables = $schema->getTables();
$columns = $table[0]->getColumns();
$type = $columns[0]->getType();

特性

  • 标准化构造函数
  • 读取模式模式(得益于修改过的 Propel 库)
  • 日期和时间辅助方法(getTimestampFormatter, hourStart, dayStart, weekStart, monthStart)
  • 引用参数数组和标识符引用的辅助方法
  • 应用 LIMIT 行为的辅助方法

支持方言

  • Microsoft Access
  • Microsoft SQL Server
  • MySQL
  • Oracle
  • Postgres
  • Redshift
  • SQLite