Examples
The example/ directory is the quickest way to see the library running without building a full project first.
Run an example from the repository root:
php example/01-quick-start.php
Each example creates its own temporary workspace, writes the queries it needs, and removes the files afterwards.
Example index
- example/01-quick-start.php Basic CRUD with SQL query files.
- example/02-parameter-binding.php Positional, named, special, and array-expanded bindings.
- example/03-type-safe-getters.php Typed fetch helpers and typed row access.
- example/04-dynamic-bindings.php
__dynamicInand__dynamicOr. - example/05-database-migrations.php
Running canonical SQL migrations through
Migrator. - example/06-multiple-connections.php Named connections and switching between collections.
- example/07-php-query-collections.php PHP-backed query collections with a custom namespace.
- example/08-sqlbuilder-query-collections.php
Query methods built with
phpgt/sqlbuilder. - example/09-sqlbuilder-overrides-and-reports.php SQL overrides alongside a PHP query collection.
[!NOTE] These examples show
phpgt/databaseon its own. In WebEngine the same query and migration approach is used, but the framework constructs the surrounding application pieces for us.