Medoo v1.7
New Create() And Drop() API
Medoo provided two API for creating table and dropping table for better table management on the project.
$database->create("account", [
"id" => [
"INT",
"NOT NULL",
"AUTO_INCREMENT",
"PRIMARY KEY"
],
"first_name" => [
"VARCHAR(30)",
"NOT NULL"
]
]);
$database->drop("account");
Index Mapping For Select Output
It's now able to set column name as the index key for the result.
$data = $database->select("post", [
"user_id" => [
"nickname",
"location",
"email"
]
]);
// Output data
[
10: {
nickname: "foo",
location: "New York",
email: "[email protected]"
},
12: {
nickname: "bar",
location: "New York",
email: "[email protected]"
}
]
Improvements
- Throw error if used table.* for all columns while joining table
- Improve code quality
Bug Fixed
- Incorrect implode usage