auraphp/Aura.SqlSchema
auraphp/Aura.SqlSchema has 40 GitHub stars and 15 forks. GitHot measured 0 stars in 24 hours and 0 in 7 days. Last checked 2026-11-13 10:49 UTC. Last push 2026-09-09.
Independent schema discovery tools for MySQL, PostgreSQL, SQLite, and Microsoft SQL Server.
实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Aura.SqlSchema
Provides facilities to read table names and table columns from a database using a PDO connection.
Foreword
Installation
This library requires PHP 5.3 or later; we recommend using the latest available version of PHP as a matter of principle. It has no userland dependencies.
It is installable and autoloadable via Composer as aura/sqlschema.
Alternatively, download a release or clone this repository, then require or include its autoload.php file.
Quality
To run the unit tests at the command line, issue phpunit at the package root. (This requires PHPUnit to be available as phpunit.)
This library attempts to comply with PSR-1, PSR-2, and PSR-4. If you notice compliance oversights, please send a patch via pull request.
Community
To ask questions, provide feedback, or otherwise communicate with the Aura community, please join our Google Group, follow @auraphp on Twitter, or chat with us on #auraphp on Freenode.
Getting Started
Instantiation
Instantiate a driver-specific schema object with a matching PDO instance:
<?php
use Aura\SqlSchema\ColumnFactory;
use Aura\SqlSchema\MysqlSchema; // for MySQL
use Aura\SqlSchema\PgsqlSchema; // for PostgreSQL
use Aura\SqlSchema\SqliteSchema; // for Sqlite
use Aura\SqlSchema\SqlsrvSchema; // for Microsoft SQL Server
use PDO;
// a PDO connection
$pdo = new PDO(...);
// a column definition factory
$column_factory = new ColumnFactory();
// the schema discovery object
$schema = new MysqlSchema($pdo, $column_factory);
?>
Fetching Table Lists
To get a list of tables in the database, issue fetchTableList():
<?php
$tables = $schema->fetchTableList();
foreach ($tables as $table) {
echo $table . PHP_EOL;
}
?>
Fetching Column Information
To get information about the columns in a table, issue fetchTableCols():
<?php
$cols = $schema->fetchTableCols('table_name');
foreach ($cols as $name => $col) {
echo "Column $name is of type "
. $col->type
. " with a size of "
. $col->size
. PHP_EOL;
}
?>
Each column description is a Column object with the following properties:
name: (string) The column nametype: (string) The column data type. Data types are as reported by the database.size: (int) The column size.scale: (int) The number of decimal places for the column, if any.notnull: (bool) Is the column marked asNOT NULL?default: (mixed) The default value for the column. Note that sometimes this will benullif the underlying database is going to set a timestamp automatically.autoinc: (bool) Is the column auto-incremented?primary: (bool) Is the column part of the primary key?
探索相关项目
Asabeneh/30-Days-Of-Python
30 Days of Python 编程挑战是一份循序渐进的指南,用于在 30 天内学习 Python 编程语言。这项挑战可能需要超过 100 天。请按自己的节奏进行。这些视频或许也有帮助:https://www.youtube.com/channel/UC7PNRuno1rzYPb1xLa4yktw
78,618 星标grafana/grafana
开放且可组合的可观测性与数据可视化平台。可对来自 Prometheus、Loki、Elasticsearch、InfluxDB、Postgres 等众多数据源的指标、日志和追踪进行可视化。
77,859 星标redis/redis
对于正在构建实时数据驱动应用的开发者而言,Redis 是首选、速度最快且功能最丰富的缓存、数据结构服务器和文档与向量查询引擎。
77,472 星标apache/superset
Apache Superset 是一个数据可视化与数据探索平台
75,495 星标

