0.2
Pre-release
Pre-release
Main changes:
-
DBUtilities
:- Improved methods a bit, like wrapping table names into quotes in the queries.
- New methods:
delete_table()
,reinit_table()
,empty_table()
,clone_table()
,copy_table()
,count_table_rows()
, andsanitize_table_name()
. This is inspired by what BerlinDB does.
-
New class
Table
: this class basically combinesTableDefinitionInterface
andDBUtilities
, to be easier to work with. -
CRUD
classes:- Renamed
get_table()
intoget_table_definition()
to prevent confusion between the classesTable
and the interfaceTableDefinitionInterface
. AbstractCRUD
: the propertytable_definition
is now private. Useget_table_definition()
in sub-classes instead.
- Renamed
-
AbstractTableDefinition
:get_table_name()
now usesDBUtilities::sanitize_table_name()
.- New method
jsonSerialize()
(from the interfaceJsonSerializable
): returns an array containing the method results. The array keys aretable_version
,table_short_name
,table_name
,table_is_global
,primary_key
,column_placeholders
,column_defaults
, andtable_schema
.json_encode()
can be used directly on the class instance now. - New magic method
__toString()
: this will simplyjson_encode()
the class.
-
TableUpgrader
:- Signature change: a
Table
object must be used as first argument instead ofTableDefinitionInterface
. - New methods
table_is_allowed_to_upgrade()
anddelete_table()
. - The table version is not deleted from the DB anymore if the table upgrade failed.
- Signature change: a