pudl-docs

PUDL Documentation

View on GitHub

PUDL Documentation

What is PUDL

PUDL stands for "PHP Universal Database Library" and can simply be described as "PDO on crack." PUDL provides a straightforward, simple, and standardized API for connecting to various database engines using the available PHP extensions transparently. Additionally, PUDL provides APIs for automatically generating SQL queries as well as processing the resulting data.

The subtle nuances of each database's SQL implementation are handled automatically behind the scenes by PUDL.

Getting Started

Supported Database Engines and PHP Extensions

Class Support Information
pudl Full The core shared API
pudlNull Full Think /dev/null, no connection made, calls return default value
pudlMySql Full Legacy MySQL (deprecated in PHP 5.5.0, removed in PHP 7.0.0)
pudlMySqli Full Modern MySQL, MariaDB, and Percona
pudlGalera Full MySqli interface extended with Galera multi-master clustering
pudlMsSql Partial Legacy Microsoft SQL Server (removed in PHP 7.0.0)
pudlSqlSrv Partial Modern Microsoft SQL Server
pudlPgSql Partial PostgreSQL
pudlSqlite Partial Local Sqlite3 file
pudlOdbc Partial Open Database Connectivity
pudlPdo Partial PHP's built in PDO
pudlClone Early A cloned interface linking to another PUDL instance
pudlShell Early JSON API accessed via piped connections on a local shell
pudlWeb Early JSON API accessed via HTTP(s)

Basic Queries

API Documentation

Classes

Constants

Prefix Information
PUDL_ Main PUDL constants
GALERA_ Galera cluster status

Interfaces

Interface Information
pudlData Used internally to identify specific data structures
pudlHelper Used internally to identify special PUDL related classes
pudlId Allows an object to be passed into an Id() function as a value
pudlValue Used internally to identify special PUDL values

Object-Relational Mapping (ORM)

Class Information
pudlObject A basic object that acts like a PHP Array
pudlOrm A hybrid between pudlObject and the main PUDL interface
pudlCollection A collection of pudlOrm objects

Importing / Exporting

PUDL Methods

SQL DML (Data Manipulation Language)

SELECT
INSERT / UPSERT / REPLACE
UPDATE
DELETE

SQL TCL (Transaction Control Language)

BEGIN / START TRANSACTION
SAVEPOINT
COMMIT TRANSACTION
ROLLBACK TRANSACTION

SQL DDL (Data Definition Language)

CREATE
ALTER
DROP
TRUNCATE
COMMENT
RENAME

SQL DCL (Data Control Language)

GRANT
REVOKE