Releases: catfan/Medoo
Medoo 1.4.1
Emergency bug fixes.
- Fix
*
for selecting all columns exec()
allow empty map
Medoo 1.4
Make Medoo Great Again
The most greatest update on Medoo history. This version included a lot of significant improvements that obviously increasing the performance and flexibility. We also redesign our official website, providing better useful content for documentation.
Prepared statement ready
Medoo is now using prepared statement for inside query execution. This will increase the query performance and also prevent SQL injection.
Add supported for data type declaration
$data = $database->select("post", [
"[>]account" => ["user_id"]
], [
"post.post_id",
"profile" => [
"account.age [Int]",
"account.is_locked [Bool]",
"account.userData [JSON]"
]
], [
"LIMIT" => [0, 2]
]);
echo json_encode($data);
// Output data
[
{
post_id: "1",
profile: {
age: 20,
is_locked: true,
userData: ["foo", "bar", "tim"]
}
},
{
post_id: "2",
profile: {
age: 25,
is_locked: false,
userData: ["mydata1", "mydata2"]
}
}
]
Add supported for LOBs and resources data type for insert() and update()
class Foo {
var $bar = "cat";
public function __wakeup()
{
$this->bar = "dog";
}
}
$object_data = new Foo();
$fp = fopen($_FILES[ "file" ][ "tmp_name" ], "rb");
$database->insert("account", [
// String value
"user_name" => "foo",
// Integer value
"age" => 25,
// Boolean value
"is_locked" => true,
// Array value
"lang" => ["en", "fr", "jp", "cn"],
// Array value encoded as JSON
"lang [JSON]" => ["en", "fr", "jp", "cn"],
// Object value
"object_data" => $object_data,
// Large Objects (LOBs)
"image" => $fp
]);
Logging option
We added a logging option for initialization. Logging feature will be disabled for better performance and less memory consumption.
$database = new Medoo([
"database_type" => "mysql",
"database_name" => "name",
"server" => "localhost",
"username" => "your_username",
"password" => "your_password",
// Enable logging
"logging" => true,
]);
New query() API, supports prepared statement
$data = $database->query(
"SELECT * FROM account WHERE user_name = :user_name AND age = :age", [
":user_name" => "John Smite",
":age" => 20
]
)->fetchAll();
Additional changes
- Supports JSON decode
- Supports multiple GROUP by
- Improve MATCH full-text search
- Improve data mapping performance
- Improve all regex matching
- Improve MSSQL and Oracle database support
Upgrading Medoo 1.2 to Medoo 1.4
There is only one change required
// From
$database->insert("account", [
"user_name" => "foo",
"email" => "foo@bar.com",
"age" => 25,
"(JSON) lang" => ["en", "fr", "jp", "cn"]
]);
// To
$database->insert("account", [
"user_name" => "foo",
"email" => "foo@bar.com",
"age" => 25,
"lang [JSON]" => ["en", "fr", "jp", "cn"]
]);
Code changes for upgrading older version to Medoo 1.4, read more
https://medoo.in/api/upgrade
New designed official website is now HTTPS also
https://medoo.in
Medoo 1.2.1
Fix initialization bug
Medoo 1.2
The new milestone version Medoo 1.2 is now released. We make Medoo more modern, powerful and compatible.
Changes
- PSR compatible
- Use namespace
- Dropped support for PHP 5.1, the minimal requirement is PHP 5.4
- New initialization
- Change all
array()
to[]
- Updated and simplified all method name with camel case
- Improve multiple insert performance
- Improve database compatible
New features
- Customizable DSN for initialization
- New API
id()
for fetching the last insert row ID - Execute customized command for initialization
- Support condition relationship between two column
- Compound like condition
- Connect condition with AND by default
[Important!!!] You will need some code change before upgrading to 1.2
See the changes and how to upgrade to Medoo 1.2
http://medoo.in/api/upgrade
We also updated the official website for better documentation. Hope you enjoy it :)
Medoo 1.1.2
- Emergency bug fix
Medoo 1.1.1
- Emergency bug fixes
Medoo 1.1
We are happy to announced that Medoo v1.1 is now released.
This version is included some awesome changes and useful features.
- New feature - data mapping
- New feature - table alias
- New
ORDER
syntax (Incompatible for old version) - Improve performance & bug fixes
Data Mapping
$data = $database->select("post", [
"[>]account" => ["user_id"]
], [
"post.post_id",
"post.content",
"userData" => [
"account.user_id",
"account.email",
"meta" => [
"account.location",
"account.gender"
]
]
], [
"LIMIT" => [0, 2]
]);
echo json_encode($data);
// Outputed data
[
{
post_id: "1",
content: "Hello world!",
userData: {
user_id: "1",
email: "foo@example.com",
meta: {
location: "New York",
gender: "male"
}
}
},
{
post_id: "2",
content: "Hey everyone",
userData: {
user_id: "2",
email: "bar@example.com",
meta: {
location: "London",
gender: "female"
}
}
}
]
New ORDER syntax (Incompatible for old version)
$database->select("account", "user_id", [
// Single condition
"ORDER" => "user_id",
// Multiple condition
"ORDER" => [
// Order by column with sorting by customized order.
"user_id" => [43, 12, 57, 98, 144, 1],
// Order by column
"register_date",
// Order by column with descending sorting
"profile_id" => "DESC",
// Order by column with ascending sorting
"date" => "ASC"
]
]);
Medoo 1.0.2
Fixed some bug from Medoo 1.0.
Medoo 1.0
The Medoo 1.0 is now on the earth.
This is the milestone for Medoo history. We got a lot of support from developer around the world, since we started the project. Thank you very much!
This version improved the code and documentation for more better quality.
And we have add this useful new features for this version.
- Table prefix
- Database transactions
Enjoy And Keep Walking :)
Medoo 0.9.8
We are happy to release the Medoo 0.9.8 today with a lot of improvement and fixes.
- Remove old LIKE feature
- Like condition supports multiple value
- Add debug mode
- Drop support for datetime covert
- Code improvement and bug fixes
- Improve documentation on official website. Add more sample and usage.