-
-
Notifications
You must be signed in to change notification settings - Fork 3
Examples
Greg Bowler edited this page Aug 31, 2026
·
3 revisions
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.phpEach example creates its own temporary workspace, writes the queries it needs, and removes the files afterwards.
- 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/database on its own. In WebEngine the same query and migration approach is used, but the framework constructs the surrounding application pieces for us.
PHP.GT/Database is a separately maintained component used by PHP.GT/WebEngine.