• Stars
    star
    549
  • Rank 77,937 (Top 2 %)
  • Language
    PHP
  • License
    MIT License
  • Created almost 13 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SQL database access through PDO.

Aura.Sql

Provides an extension to the native PDO along with a profiler and connection locator. Because ExtendedPdo is an extension of the native PDO, code already using the native PDO or typehinted to the native PDO can use ExtendedPdo without any changes.

Added functionality in Aura.Sql over the native PDO includes:

  • Lazy connection. ExtendedPdo connects to the database only on method calls that require a connection. This means you can create an instance and not incur the cost of a connection if you never make a query.

  • Decoration. DecoratedPdo can be used to decorate an existing PDO instance. This means that a PDO instance can be "extended" at runtime to provide the ExtendedPdo behaviors.

  • Array quoting. The quote() method will accept an array as input, and return a string of comma-separated quoted values.

  • New perform() method. The perform() method acts just like query(), but binds values to a prepared statement as part of the call. In addition, placeholders that represent array values will be replaced with comma- separated quoted values. This means you can bind an array of values to a placeholder used with an IN (...) condition when using perform().

  • New fetch*() methods. The new fetch*() methods provide for commonly-used fetch actions. For example, you can call fetchAll() directly on the instance instead of having to prepare a statement, bind values, execute, and then fetch from the prepared statement. All of the fetch*() methods take an array of values to bind to to the query statement, and use the new perform() method internally.

  • New yield*() methods. These are complements to the fetch*() methods that yield results instead of returning them.

  • Exceptions by default. ExtendedPdo starts in the ERRMODE_EXCEPTION mode for error reporting instead of the ERRMODE_SILENT mode.

  • Profiler. An optional query profiler is provided, along with an interface for other implementations, that logs to any PSR-3 interface.

  • Connection locator. A optional lazy-loading service locator is provided for picking different database connections (default, read, and write).

Installation and Autoloading

This package is installable and PSR-4 autoloadable via Composer as aura/sql.

Alternatively, download a release, or clone this repository, then map the Aura\Sql\ namespace to the package src/ directory.

Dependencies

This package requires PHP 8.1 or later; it has also been tested on PHP 8.1-8.2. We recommend using the latest available version of PHP as a matter of principle.

Aura library packages may sometimes depend on external interfaces, but never on external implementations. This allows compliance with community standards without compromising flexibility. For specifics, please examine the package composer.json file.

Quality

Scrutinizer Code Quality Code Coverage Build Status PDS Skeleton

This project adheres to Semantic Versioning.

To run the unit tests at the command line, issue composer install and then ./vendor/bin/phpunit at the package root. (This requires Composer to be available as composer.)

This package 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 other Aura users, please join our Google Group, follow @auraphp, or chat with us on Freenode in the #auraphp channel.

Documentation

This package is fully documented here.

More Repositories

1

Aura.Router

A web router implementation for PHP.
PHP
491
star
2

Aura.SqlQuery

Independent query builders for MySQL, PostgreSQL, SQLite, and Microsoft SQL Server.
PHP
445
star
3

Aura.Di

Dependency Injection System
PHP
347
star
4

Aura.Session

Tools for managing sessions, including session segments and read-once messages
PHP
201
star
5

Aura.Filter

Validate and sanitize arrays and objects.
PHP
159
star
6

Aura.Auth

Provides a unified interface to local and remote authentication systems.
PHP
132
star
7

Aura.Marshal

A data-marshaling toolset
PHP
117
star
8

Aura.Cli

Command-Line Interface tools
PHP
104
star
9

Aura.Framework

Composes the various aura v1 packages into v1 framework.
PHP
100
star
10

Aura.Autoload

A PSR-0 compliant autoloader
PHP
96
star
11

Aura.Intl

Internationalization tools, particularly message translation.
PHP
90
star
12

Aura.View

Provides TemplateView and TwoStepView using PHP as the templating language, with support for partials, sections, and helpers.
PHP
86
star
13

Aura.Web

Web controllers and support classes
PHP
82
star
14

Aura.Http

HTTP Request and Response tools
PHP
72
star
15

Aura.Input

Tools to describe HTML form fields and values.
PHP
65
star
16

system

A full-stack framework built from Aura library packages.
PHP
63
star
17

Aura.Web_Project

A web framework project skeleton.
PHP
61
star
18

Aura.Payload

A Domain Payload implementation.
PHP
55
star
19

Aura.Html

Provides HTML escapers and helpers, including form input helpers.
PHP
52
star
20

Aura.SqlSchema

Independent schema discovery tools for MySQL, PostgreSQL, SQLite, and Microsoft SQL Server.
PHP
41
star
21

Aura.Dispatcher

Object factory and method invoker.
PHP
38
star
22

Aura.Accept

Provides content-negotiation tools using Accept* headers.
PHP
36
star
23

Aura.Signal

SignalSlots / EventHandler Implementation
PHP
33
star
24

Aura.Framework_Project

A minimal web+CLI framework built from Aura v2 components.
PHP
29
star
25

auraphp.github.io

Static pages for github site
HTML
27
star
26

Aura.Web_Kernel

The kernel files for a web project.
PHP
25
star
27

Aura.Uri

Tools to build and modify URLs.
PHP
24
star
28

Aura.SqlMapper_Bundle

A DataMapper and UnitOfWork implementation.
PHP
16
star
29

Aura.Cli_Project

The skeleton for a CLI project.
PHP
14
star
30

Aura.Includer

Include multiple files from specified directories, in order, with variables injected into a limited include scope.
PHP
14
star
31

Aura.Payload_Interface

An interface package for Domain Payload implementations.
PHP
13
star
32

Aura.Project_Kernel

A generic project kernel.
PHP
9
star
33

Aura.Cli_Kernel

The kernel files for a CLI project.
PHP
6
star
34

Aura.Framework_Demo

"Hello World" demos for Aura version 1 framework
PHP
6
star
35

Aura.Filter_Interface

Interface for Filter objects.
PHP
5
star
36

bin

Unix CLI tools for Aura project management
PHP
5
star
37

installer-system

Composer installer for Aura systems.
PHP
3
star
38

installer-default

Composer installer for default Composer setups.
PHP
3
star
39

Example.Testing

An example package for release testing
PHP
2
star