Releases: iloElias/maestro
Releases · iloElias/maestro
1.3.1 Database DDL creation performance changes
1.3.0 Table creation changes
The priority of __construct()
was moved to compose()
method. The functionality was not removed, but is available to use for custom object build.
The compose()
method has now the same properties as a __construct()
had previous updates. Use compose method to custom database table builds.
1.2.8 Hot fix to update query builder
[update] - update query builder updated
1.2.7 Hot fix on table fetching method
[fix] - minor change
1.2.6 Updated conditional handlers(where, in, having)
[doc] - better empty params handling
1.2.5 Updated conditionals, group and custom operations
[update] - updated conditionals, added group and custom operations
1.2.4 Updated conditionals, conditional group and custom operations added
[update] - updated conditionals, added group and custom operations
1.2.3 Query builder update
New way of processing data to avoid SQL injection
1.2.2 Function declaration moved to database
To improve the code and fix some bugs, the database function declaration was moved to the database constructor:
<?php
namespace Maestro\Example;
use Ilias\Maestro\Abstract\Database;
use Ilias\Maestro\Types\Postgres;
final class MaestroDb extends Database
{
public Hr $hr;
public Social $social;
public function __construct()
{
self::declareFunction(
'generate_four_digit_auth_code',
Postgres::TEXT,
'CREATE OR REPLACE FUNCTION generate_four_digit_auth_code() RETURNS TEXT AS $$ BEGIN RETURN CAST(FLOOR(1000 + RANDOM() * 9000) AS TEXT); END; $$ LANGUAGE plpgsql;'
);
}
}
1.2.1 Function declaration
Now you can add functions to your database:
<?php
namespace Maestro\Example;
use Ilias\Maestro\Abstract\Schema;
use Ilias\Maestro\Types\Postgres;
final class Hr extends Schema
{
public User $user;
public AuthCode $authCode;
public function __construct()
{
self::declareFunction(
'generate_four_digit_auth_code',
Postgres::TEXT,
'CREATE OR REPLACE FUNCTION generate_four_digit_auth_code() RETURNS TEXT AS $$ BEGIN RETURN CAST(FLOOR(1000 + RANDOM() * 9000) AS TEXT); END; $$ LANGUAGE plpgsql;'
);
}
}