2017 © Pedro Peláez
 

library common

A mini framework for Database access, Dependency injection and Date manipulation.

image

c00/common

A mini framework for Database access, Dependency injection and Date manipulation.

  • Thursday, March 15, 2018
  • by c00
  • Repository
  • 1 Watchers
  • 0 Stars
  • 217 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 69 Versions
  • 14 % Grown

The README.md

Common

A mini framework for common challenges such as database querying (ORM), dependency injection and date manipulation., (*1)

This is simply a personal usage toolkit that exists here for 2 reasons: * So I can easily import it in my future projects with Composer * To show potential employers code samples., (*2)

The Query Builder class is tested quite well. Not every SQL use case is covered, but the basic needs such as selects, joins, where, order by, group, max, avg, count are all covered., (*3)

Documentation

This wil fill up slowly. I'm currently documenting the most important Features. But feel free to send me messages about something missing and I will expand. Feedback will motivate me to expand on this package., (*4)

It's currently still in Beta, tho I've the ORM portion extensively in a few different projects. Tests do cover most of the functionality., (*5)

ORM - Super simple Database mappings

The ORM portion allows you to map Objects to the database with minimal setup. Objects just need to extend AbstractDatabaseObject. You can now save and query the database., (*6)

When just extending AbstractDatabaseObject without any extra setup, it will read and write to a database table of your choosing, mapping columns on property names. With a little setup it will use mapping of your choosing (including casting to your own objects). If that's still not enough you can override the toArray() and fromArray() functions to do the work yourself. (But that kind of defeats the purpose of having an ORM.), (*7)

Examples are found in the showAndTell folder. Short versions are found below:, (*8)

Example 1: Get all users from the database

$allUsersQuery = Qry::select()
    ->from($userTable)
    ->asClass(User::class);

//All users will be an array over User objects.
$allUsers = $database->getRows($allUsersQuery);

Example 2: Get one user from the database

$getQuery = Qry::select()
    ->from($userTable)
    ->where('id', '=', 1)
    ->asClass(User::class);

$user = $database->getRow($getQuery);

Example 3: Insert a user to the database

$query = Qry::insert($userTable, $user);

$database->insertRow($query);

Database - Easy and safe Database communications

Connect to a MySQL / MariaDB database with PDO. Using the Querybuilder ensures proper prepared statements., (*9)

Docs coming soon..., (*10)

Qry - The querybuilder

A Querybuilder that aims to stay as close to SQL as possible to minimize the learning curve. Automatically prepares your statements for you., (*11)

Automatically converts your objects to database-ready arrays and vice-versa., (*12)

Docs coming soon..., (*13)

CovleDate - Date comparisons and casting

Docs coming soon..., (*14)

Settings - Easy setting saving and loading to a JSON file.

Docs coming soon..., (*15)

Dependencies - Simple dependency injection with type hinting

Docs coming soon..., (*16)

Todo:

  • Bump to version 1.0
  • Add a bunch of docs and samples.
  • Use polymorphism for Qry. Make Qry abstract, and make select, update, insert and delete extend it.
  • Retire old Query class

QueryBuilder

  • Add ->and and ->or support for where clauses and Join clauses

License - MIT

So do whatever you want with it., (*17)

The Versions

15/03 2018

dev-master

9999999-dev

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

15/03 2018

0.12.3

0.12.3.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

28/02 2018

0.12.2

0.12.2.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

25/02 2018

0.9.11

0.9.11.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

25/02 2018

0.12.1

0.12.1.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

08/01 2018

0.12.0

0.12.0.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

01/01 2018

0.11.1

0.11.1.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

01/01 2018

0.11.0

0.11.0.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

04/11 2017

0.10.0

0.10.0.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

06/09 2017

0.9.10

0.9.10.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

31/08 2017

0.9.9

0.9.9.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

25/08 2017

0.9.8

0.9.8.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

25/08 2017

0.9.7

0.9.7.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

23/08 2017

0.9.6

0.9.6.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

23/08 2017

dev-deepJoins

dev-deepJoins

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

23/08 2017

0.9.5

0.9.5.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

17/08 2017

0.9.4

0.9.4.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

27/07 2017

0.9.3

0.9.3.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

22/07 2017

0.9.2

0.9.2.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

21/07 2017

0.9.1

0.9.1.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

21/07 2017

dev-poly

dev-poly

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

21/07 2017

0.9.0

0.9.0.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

15/07 2017

0.8.6

0.8.6.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

15/07 2017

0.8.5

0.8.5.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

27/06 2017

0.8.4

0.8.4.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

26/06 2017

0.8.3

0.8.3.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

24/06 2017

0.8.2

0.8.2.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

24/06 2017

0.8.1

0.8.1.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

01/06 2017

0.8.0

0.8.0.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

01/06 2017

0.7.16

0.7.16.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

01/06 2017

0.7.15

0.7.15.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

29/05 2017

0.7.14

0.7.14.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

20/05 2017

0.7.13

0.7.13.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

19/05 2017

0.7.12

0.7.12.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

05/04 2017

0.7.11

0.7.11.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

10/03 2017

0.7.10

0.7.10.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

13/02 2017

0.7.9

0.7.9.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

09/02 2017

0.7.8

0.7.8.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

01/02 2017

0.7.7

0.7.7.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

26/01 2017

0.7.6

0.7.6.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

16/12 2016

0.7.5

0.7.5.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

06/12 2016

0.7.4

0.7.4.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

05/12 2016

0.7.3

0.7.3.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

05/12 2016

0.7.2

0.7.2.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

04/12 2016

0.7.1

0.7.1.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

04/12 2016

0.7.0

0.7.0.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

04/12 2016

dev-groupranges

dev-groupranges

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

04/12 2016

0.6.8

0.6.8.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

04/12 2016

0.6.7

0.6.7.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

18/11 2016

0.6.6

0.6.6.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

14/11 2016

0.6.5

0.6.5.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

11/11 2016

0.6.4

0.6.4.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

05/11 2016

0.6.3

0.6.3.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

05/11 2016

0.6.2

0.6.2.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

04/11 2016

0.6.1

0.6.1.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

03/11 2016

0.6.0

0.6.0.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

18/10 2016

0.5.7

0.5.7.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

17/10 2016

0.5.6

0.5.6.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

13/10 2016

0.5.5

0.5.5.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

13/10 2016

0.5.4

0.5.4.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

10/10 2016

0.5.3

0.5.3.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

10/10 2016

0.5.2

0.5.2.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

10/10 2016

0.5.1

0.5.1.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

09/10 2016

0.5

0.5.0.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

07/10 2016

0.1.4

0.1.4.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

05/10 2016

0.1.3

0.1.3.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

01/10 2016

0.1.1

0.1.1.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

01/10 2016

0.1.2

0.1.2.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo

29/09 2016

0.1

0.1.0.0

A mini framework for Database access, Dependency injection and Date manipulation.

  Sources   Download

MIT

The Development Requires

by Coo