All Projects → tflori → orm

tflori / orm

Licence: other
just another orm...

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to orm

Company Website Pro
现代公司企业官网以及电子商务产品网站
Stars: ✭ 172 (+1046.67%)
Mutual labels:  pdo
CircleBilling
Official release of CircleBilling
Stars: ✭ 28 (+86.67%)
Mutual labels:  pdo
pdo-dbal
A simple database abstraction layer using PHP and PDO
Stars: ✭ 14 (-6.67%)
Mutual labels:  pdo
Zend Diagnostics
Universal set of diagnostic tests for PHP applications.
Stars: ✭ 192 (+1180%)
Mutual labels:  pdo
mysqly
Full-featured opensource small-overhead PHP data framework for Mysql built for fast and efficient development
Stars: ✭ 18 (+20%)
Mutual labels:  pdo
apostilas
Apostilas sobre diversos assuntos: PHP, PDO, MySQL, PHPOO, MVC, mobile, scratch, git, github, docker, vps, alpine linux, segurança na wev, servidores, etc
Stars: ✭ 49 (+226.67%)
Mutual labels:  pdo
Uxdm
🔀 UXDM helps developers migrate data from one system or format to another.
Stars: ✭ 159 (+960%)
Mutual labels:  pdo
lpmj6
Examples from Learning PHP, MySQL & JavaScript Ed 6 by Robin Nixon (plus all examples from previous editions)
Stars: ✭ 186 (+1140%)
Mutual labels:  pdo
pdo-mysql-login-register
Simple PHP Login & Register using PDO MySQL
Stars: ✭ 37 (+146.67%)
Mutual labels:  pdo
crud-mvc-php
Projeto de aplicação simples em php utilizando autoload e PDO.
Stars: ✭ 12 (-20%)
Mutual labels:  pdo
Hydrahon
🐉 Fast & standalone PHP MySQL Query Builder library.
Stars: ✭ 194 (+1193.33%)
Mutual labels:  pdo
Database
💾 A database layer with a familiar PDO-like API but much more powerful. Building queries, advanced joins, drivers for MySQL, PostgreSQL, SQLite, MS SQL Server and Oracle.
Stars: ✭ 251 (+1573.33%)
Mutual labels:  pdo
Aura.SqlSchema
Independent schema discovery tools for MySQL, PostgreSQL, SQLite, and Microsoft SQL Server.
Stars: ✭ 39 (+160%)
Mutual labels:  pdo
Pdo
Connecting to MySQL in PHP using PDO.
Stars: ✭ 187 (+1146.67%)
Mutual labels:  pdo
database
Database abstraction layer
Stars: ✭ 90 (+500%)
Mutual labels:  pdo
Phive Queue
$queue->push('I can be popped off after', '10 minutes');
Stars: ✭ 161 (+973.33%)
Mutual labels:  pdo
WoWSimpleRegistration
Simple Registration page for TrinityCore/AzerothCore/AshamaneCore/CMangos
Stars: ✭ 121 (+706.67%)
Mutual labels:  pdo
Simple-Social-Network
Micro Social Network developed in PHP, MySQL, BOOTSTRAP 3 and VUE.JS 2
Stars: ✭ 18 (+20%)
Mutual labels:  pdo
stefano-tree
Framework agnostic Nested Set (MPTT) implementation for PHP
Stars: ✭ 24 (+60%)
Mutual labels:  pdo
spe
A series of PHP8 examples based around a super simple MVC framework (WIP)
Stars: ✭ 14 (-6.67%)
Mutual labels:  pdo

tflori/orm

.github/workflows/push.yml Test Coverage Maintainability Latest Stable Version Total Downloads License

Logo

TL;DR Others suck, we can do it better.

Why to create another ORM? There are not enough ORM implementations for PHP already?

Yes, there are a lot of implementations:

  • doctrine/orm
    • heavy: 8,8 MB of everything that you don't need, 6 direct dependencies with own dependencies
    • annotations that makes it unreadable
    • big amount of queries or very slow queries when it comes to join across multiple tables
  • propel/propel
    • still not stable 2.0-dev
    • even more heavy than doctrine
    • requires a lot of configurations
  • j4mie/idiorim and j4mie/paris
    • uses a lot of static methods and gets hard to test
    • not compatible to existing dependecy injection models
    • last update 2 years ago
    • everything in one file
    • ...

This implementation will have the following features:

  • no configuration required
    • ok some bit for sure (e.g. how to connect to your database?)
    • of course this is only possible if you setup your database as we think your database should look like. If not you should only have to setup the rules of your system and naming conventions.
  • simple to use
  • lightweight sources
  • fast

How to achieve this features? The main goal of Doctrine seems to abstract everything - at the end you should be able to replace the whole DBMS behind your app and switch from postgresql to sqlite. That requires not only a lot of sources. It also requires some extra cycles to get these abstraction to work.

This library will only produce ANSI-SQL that every SQL database should understand. Other queries have to be written by hand. This has two reasons:

  1. You can write much faster and efficient queries
  2. We don't need to write a lot of abstraction (more code; more bugs)

This library will not fetch any mistake a developer can make. It aims to be a helper to store data in your database. Not to replace your database and your knowledge how to use this database. You can make a lot of errors - less than without this library but still a lot. When you make an error that is not catched (mostly we catch only mistakes that would cause a fatal error instead) you will get a PDOException.

Setup

Install it via composer, configure it, use it.

composer require tflori/orm
<?php

$entityManager = new ORM\EntityManager([
      ORM\EntityManager::OPT_CONNECTION => ['pgsql', 'mydb', 'postgres']
]);

$user = $entityManager->fetch(User::class, 1);

echo $user->username;

Read the docs for more information.

Known Issues

Composite Primary Keys

#52 Composite primary keys require SQLite >= 3.15 (or another database) to get the synchronization after insert working. The syntax used got added in SQLite 3.15.

Contribute

Please follow PSR-2 style guide and use this command to update the api reference documentation:

$ docker run --rm --user $(id -u) -v $(pwd):/data -v $(pwd)/docs/_reference:/opt/phpdoc/data/templates/_reference iras/phpdoc2:2 phpdoc -c phpdoc.xml

Before creating a pull request please make sure that the unit tests are green and the coverage remains the same:

$ docker run --rm --user $(id -u) -v $(pwd):/app -w /app iras/php7 vendor/bin/phpunit
### with coverage:
$ docker run --rm --user $(id -u) -v $(pwd):/app -w /app iras/php7 php -dzend_extension=xdebug.so vendor/bin/phpunit --coverage-text
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].