bearlikelion/medoo-provider

Service Provider for use of the Medoo ORM in the Autarky framework.

1.0.0 2014-11-20 16:22 UTC

This package is auto-updated.

Last update: 2024-11-27 05:35:56 UTC


README

Medoo is a lightweight easy and powerful database framework compatible with various databases including MySQL, MSSQL, SQLite, MariaDB, Sybase, Oracle, PostgreSQL and more.

Autarky is a PHP framework aimed at developers wit a focus on freedom of choice.

Usage Instructions

First, update database config to use a new, Medoo specific connection.

return [
	/** The connection to use. */
	'connection' => 'medoo',

	/** The connections to choose from. */
	'connections' => [
		'medoo' => [
			/** Required */
			'server' => '{sever_host}',
			'username' => '{username}',
			'password' => '{password}',
			'database_type' => 'mysql',
			'database_name' => '{database_name}',

			/** Optional */
			'port' => 3306,
			'charset' => 'utf8',
		]
	]
];

Once configured, you can resolve Medoo using Autarky's container

	$container = $this->app->getContainer();
	$db = $container->resolve('Medoo'); // Medoo is also aliased as DB

	$student = $db->get('students', '*', [
		'name' => 'Bobby Tables'
	]);

For further documentation on using Medoo, please consult the documentation.