-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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()`, and `sanitize_table_name()`. This is inspired by what BerlinDB does. - New class `Table`: this class basically combines `TableDefinitionInterface` and `DBUtilities`, to be easier to work with. - `CRUD` classes: - Renamed `get_table()` into `get_table_definition()` to prevent confusion between the classes `Table` and the interface `TableDefinitionInterface`. - `AbstractCRUD`: the property `table_definition` is now private. Use `get_table_definition()` in sub-classes instead. - `AbstractTableDefinition`: - `get_table_name()` now uses `DBUtilities::sanitize_table_name()`. - New method `jsonSerialize()` (from the interface `JsonSerializable`): returns an array containing the method results. The array keys are `table_version`, `table_short_name`, `table_name`, `table_is_global`, `primary_key`, `column_placeholders`, `column_defaults`, and `table_schema`. `json_encode()` can be used directly on the class instance now. - New magic method `__toString()`: this will simply `json_encode()` the class. - `TableUpgrader`: - Signature change: a `Table` object must be used as first argument instead of `TableDefinitionInterface`. - New methods `table_is_allowed_to_upgrade()` and `delete_table()`. - The table version is not deleted from the DB anymore if the table upgrade failed.
- Loading branch information
1 parent
86e3968
commit 07b3f9b
Showing
10 changed files
with
663 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.