Profile cover photo
Profile photo
Alexander Romanenko
199 followers -
PHP + Zend Framework developer with focus on maintainable architecture.
PHP + Zend Framework developer with focus on maintainable architecture.

199 followers
About
Alexander's interests
View all
Alexander's posts

Post has attachment
Might as well make Zend DB as compatible with PostgreSQL as possible beyond indexes. Please report any usecases that generate invalid SQL at https://github.com/zendframework/zend-db/pull/163 and I will update decorator accordingly.

Started working on tutorial for database migrations. Essentially, to continue with authentication, LDAP or not, need to save user entities to database. To have any interaction with database, need schema created. This in turn, means lots of DDL (Data Definition Language -> syntax like CREATE TABLE, ALTER TABLE etc.)

I planned to use PostgreSQL but it breaks on Index creation. Zend DB DDL is targeted mostly for MySQL syntax. So even though ZF is said to support it, the libraries are there, usage of the libraries breaks right away. Experienced user will pick up on where the problem is and drop to manual queries, but those who are not, will wonder for a while why what they are doing is not working.

Zend DB creates platform specific code in a really cool decorator style. There are basic CreateTable, AlterTable, etc classes with a $specification property that tries to be as database agnostic as possible with a syntax mappings for common SQL/DDL commands. Then, each platform is instantiated as a decorator that wraps the object and overrides processing of $specification strings.

So far, I completed CreateTableDecorator for PostgreSQL. Now, working on AlterTableDecorator. AlterTable is a bit harder because base specification is really far from PostgreSQL syntax and has lots of trailing commas left as placeholders that need sanitizing.

Doing this takes away from recording more videos so I will have to pause this bug fix at basic index creation without testing further options. An awkward part will be having to say "Do not use Zend DDL that you see because they are broken, going to use manual version until my PR is merged", and that is, if the maintainers even accept it.

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment

Post has attachment
Wait while more posts are being loaded