Skip to content

Conversation

@simon-mundy
Copy link
Collaborator

The documentation for sql-ddl.md (available at https://docs.laminas.dev/laminas-db/sql-ddl/ for reference) shows some detail but does not show the full scope of these classes and methods.

This PR goes further and re-organises the existing sections, adds further examples and optimises syntax.

Closes #88

…s, additional SQL output demonstrations, and expanded Docker deployment options.
Split docs files and re-ordered
2-pass optimisation of examples and introductions

Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
Split chapters/examples
Linted documentation

Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
Split chapters/examples
Linted documentation

Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
… documentation-improvements

# Conflicts:
#	docs/book/adapter.md
#	docs/book/adapters/adapter-aware-trait.md
#	docs/book/application-integration/usage-in-a-laminas-mvc-application.md
#	docs/book/application-integration/usage-in-a-mezzio-application.md
#	docs/book/docker-deployment.md
#	docs/book/index.md
#	docs/book/metadata.md
#	docs/book/metadata/examples.md
#	docs/book/metadata/intro.md
#	docs/book/metadata/objects.md
#	docs/book/profiler.md
#	docs/book/result-set/advanced.md
#	docs/book/result-set/examples.md
#	docs/book/result-set/intro.md
#	docs/book/row-gateway.md
#	docs/book/sql-ddl.md
#	docs/book/sql-ddl/advanced.md
#	docs/book/sql-ddl/alter-drop.md
#	docs/book/sql-ddl/columns.md
#	docs/book/sql-ddl/constraints.md
#	docs/book/sql-ddl/examples.md
#	docs/book/sql-ddl/intro.md
#	docs/book/sql.md
#	docs/book/sql/examples.md
#	docs/book/sql/insert.md
#	docs/book/sql/intro.md
#	docs/book/sql/select.md
#	docs/book/sql/update-delete.md
#	docs/book/sql/where-having.md
#	docs/book/table-gateway.md

Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
@simon-mundy simon-mundy added this to the 0.4.0 milestone Dec 8, 2025
@github-project-automation github-project-automation bot moved this to Todo in @phpdb Dec 8, 2025
@simon-mundy simon-mundy self-assigned this Dec 8, 2025
@simon-mundy simon-mundy requested a review from tyrsson December 8, 2025 06:11
@simon-mundy simon-mundy added documentation Improvements or additions to documentation enhancement New feature or request labels Dec 8, 2025
simon-mundy and others added 6 commits December 8, 2025 17:13
Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
Signed-off-by: Simon Mundy <46739456+simon-mundy@users.noreply.github.com>
Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
… documentation-improvements

# Conflicts:
#	.markdownlint.json

Signed-off-by: Simon Mundy <simon.mundy@peptolab.com>
@tyrsson tyrsson modified the milestones: 0.4.0, 0.4.1 Dec 9, 2025
Base automatically changed from 0.4.x to 0.5.x December 19, 2025 02:44
@simon-mundy simon-mundy moved this from Todo to In Progress in @phpdb Dec 23, 2025
Copy link
Member

@tyrsson tyrsson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is still unresolved comments and at least one change is incorrect for the return type of AdapterAwareInterface getDbAdapter method.

use PhpDb\Adapter\Adapter;
- Base adapter and interfaces
- Abstract PDO driver classes
- Platform abstractions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TableGateway/RowGateway Features was missed here.

'database' => 'path/to/sqlite.db',
```php title="MySQL Connection"
use PhpDb\Adapter\Adapter;
use PhpDb\Mysql\Driver\Mysql;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The namespaces here are incorrect.

PhpDb\Adapter\Mysql\Driver\Mysqli\Mysqli
PhpDb\Adapter\Mysql\Driver\Pdo\Pdo

I plan to refactor this before mysql 1.0.0 but its going to take a lot of work and I wanted everything stable before starting it.

'platform' => 'IbmDb2',
'platform_options' => ['quote_identifiers' => false],
]);
$adapter = new Adapter($driver, new MysqlPlatform());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is incorrect. The PhpDb\Adapter\Mysql\Driver\Platform instance requires a Driver instance as a constructor argument.

From this `DriverInterface`, you can
From this `DriverInterface`, you can:

- Determine the name of the platform this driver supports (useful for choosing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Point 1 and 2 here are really not relevant any longer. The code has just not been refactored to that point as of yet. I would not promote checking the Platform Name as this will very likely be removed.

public function getDbAdapter(): ?AdapterInterface
{
return $this->adapter ?? null;
return $this;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method can't return the AdapterAwareInterface type. It must return the AdapterInterface instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

[RFC]: Documentation for Sql Ddl

3 participants