Skip to content

Releases: catfan/Medoo

Medoo v1.7.6

26 Oct 06:32
Compare
Choose a tag to compare
  • Fixed error information for statement
  • Fixed data type conversion for select() with single column

Medoo v1.7.5

12 Oct 13:20
Compare
Choose a tag to compare
  • Emergency fix column name coverage for columnQuote()

Medoo v1.7.4

12 Oct 11:23
Compare
Choose a tag to compare
  • Fixed incorrect id() result after executing query with error
  • Fixed columnQuote for security issue reported by Snyk

Medoo v1.7.3

14 Aug 13:49
Compare
Choose a tag to compare
  • Bug fix for index mapping

Medoo v1.7.2

13 Jul 14:57
Compare
Choose a tag to compare
  • Emergency bug fix for selecting single column

Medoo v1.7.1

13 Jul 06:57
Compare
Choose a tag to compare
  • Emergency bug fix for buildJoin()

Medoo v1.7

12 Jul 18:56
Compare
Choose a tag to compare

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: "foo@example.com"
	},
 
	12: {
		nickname: "bar",
		location: "New York",
		email: "bar@medoo.in"	
	}
]

Improvements

  • Throw error if used table.* for all columns while joining table
  • Improve code quality

Bug Fixed

  • Incorrect implode usage

Medoo v1.6.1

08 Dec 20:27
Compare
Choose a tag to compare

Fixed some MSSQL compatibility bugs

Medoo v1.6

08 Oct 07:20
Compare
Choose a tag to compare

Improved initialization

Medoo 1.6 is now supported more connection options, and allowed passing PDO object for initialization. Check out more detail from https://medoo.in/api/new

$database = new Medoo([
	// required
	'database_type' => 'mysql',
	'database_name' => 'name',
	'server' => 'localhost',
	'username' => 'your_username',
	'password' => 'your_password',

	// [optional]
	'collation' => 'utf8mb4_general_ci',

	// [optional] The application name for MSSQL
	'appname' => 'test',

	// [optional] MSSQL connection options
	'application_intent' => 'ReadOnly',
	'attach_db_file_name' => './database.sql',
	....
]);
$pdo = new PDO('mysql:dbname=test;host=127.0.0.1', 'user', 'password');

$database = new Medoo([
	// Initialized and connected PDO object
	'pdo' => $pdo,

	// [optional] Medoo will have different handle method according to different database type
	'database_type' => 'mysql'
]);
try {
	$database = new Medoo([
		'database_type' => 'mysql',
		'database_name' => 'name',
		'server' => 'localhost',
		'username' => 'your_username',
		'password' => 'your_password',
	]);
}
catch (Exception $e) {
	echo $e->getMessage();
}

// Will output: Incorrect connection options

New rand() API

Medoo provided a new way for getting randomized data. It's also compatible with other database.

$data = $database->rand("account", [
	"user_name",
	"email"
], [
	"user_id[>]" => 100
]);

Output DSN String for info()

info() will output the DSN string now. You can check out this for debug database connection.

print_r($database->info());

/*
Array
(
	[server] => Uptime: 5000  Threads: 1  Questions: 15  Slow queries: 0  Opens: 67  Flush tables: 1
		Open tables: 60  Queries per second avg: 0.002
	[client] => mysqlnd 5.0.10 - 20111026 - $Id: a707c415db32080b3752b232487a435ee0372157 $
	[driver] => mysql
	[version] => 5.6.10
	[connection] => localhost via TCP/IP
	[dsn] => mysql:dbname=test;host=127.0.0.1
)
*/'

Improvements

  • Call aggregate methods without magic call
  • get() returns NULL instead of False if find nothing
  • Handle MariaDB as same as MySQL
  • Code simplified and improved performance

Bug Fixed

  • Match keyword is only supported for MySQL
  • Execute special command for customized DSN connection

Medoo v1.5.7

14 Jun 19:00
Compare
Choose a tag to compare

This version included some tiny bug fixes.