|
3 | 3 | [](https://github.com/compositephp/db/actions)
|
4 | 4 | [](https://codecov.io/gh/compositephp/db/)
|
5 | 5 |
|
6 |
| -Composite DB is lightweight and fast PHP ORM, DataMapper and Table Gateway which allows you to represent your SQL tables |
| 6 | +Composite DB is lightweight and fast PHP DataMapper and Table Gateway which allows you to represent your SQL tables |
7 | 7 | scheme in OOP style using full power of PHP 8.1+ class syntax.
|
8 | 8 |
|
9 | 9 | It also gives you CRUD, query builder and automatic caching out of the box, so you can start
|
10 | 10 | to work with your database from php code in a minutes!
|
11 | 11 |
|
12 | 12 | Overview:
|
13 |
| -* [Mission](#mission) |
| 13 | +* [Features](#features) |
14 | 14 | * [Requirements](#requirements)
|
15 | 15 | * [Installation](#installation)
|
16 | 16 | * [Quick example](#quick-example)
|
17 | 17 | * [Documentation](doc/README.md)
|
18 | 18 |
|
19 |
| -## Mission |
20 |
| -You probably may ask, why do you need another ORM if there are already popular Doctrine, CycleORM, etc.? |
21 |
| - |
22 |
| -Composite DB solves multiple problems: |
| 19 | +## Features |
23 | 20 |
|
24 | 21 | * **Lightweight** - easier entity schema, no getters and setters, you don't need attributes for each column definition,
|
25 | 22 | just use native php class syntax.
|
26 |
| -* **Speed** - it's 1.5x faster in pure SQL queries mode and many times faster in automatic caching mode. |
27 |
| -* **Easy caching** - gives you CRUD operations caching out of the box and in general its much easier to work with cached "selects". |
| 23 | +* **Speed** - it's 1.5x faster in pure SQL queries mode and many times faster in automatic caching mode (see [benchmark](https://github.com/compositephp/php-orm-benchmark)). |
| 24 | +* **Easy caching** - gives you CRUD operations caching out of the box and in general it's much easier to work with cached "selects". |
28 | 25 | * **Strict types** - Composite DB forces you to be more strict typed and makes your IDE happy.
|
29 | 26 | * **Hydration** - you can serialize your Entities to plain array or json and deserialize them back.
|
30 |
| -* **Flexibility** - gives you more freedom to extend Repositories, for example its easier to build sharding tables. |
| 27 | +* **Flexibility** - gives you more freedom to extend Repositories, for example it's easier to build sharding tables. |
31 | 28 | * **Code generation** - you can generate Entity and Repository classes from your SQL tables.
|
32 |
| -* **Division of responsibility** - there is no "god" entity manager, every Entity has its own Repository class and its the only entry point to make queries to your table. |
| 29 | +* **Division of responsibility** - every Entity has its own Repository class, and it's the only entry point to make queries to your table. |
33 | 30 |
|
34 | 31 | It also has many popular features such as:
|
35 | 32 |
|
36 | 33 | * **Query Builder** - build your queries with constructor, based on [doctrine/dbal](https://github.com/doctrine/dbal)
|
37 | 34 | * **Migrations** - synchronise your php entities with database tables
|
38 | 35 |
|
39 |
| -But there is 1 sacrifice for all these features - there is no support for relations in Composite DB. Its too much |
40 |
| -uncontrollable magic and hidden bottlenecks with "JOINs" and its not possible to implement automatic caching with |
41 |
| -relations. We recommend to have full control and make several cached select queries instead of "JOINs". |
42 |
| - |
43 |
| -### When you shouldn't use Composite DB |
44 |
| - |
45 |
| -1. If you have intricate structure with many foreign keys in your database |
46 |
| -2. You 100% sure in your indexes and fully trust "JOINs" performance |
47 |
| -3. You dont want to do extra cached select queries and want some magic |
48 |
| - |
49 | 36 | ## Requirements
|
50 | 37 |
|
51 | 38 | * PHP 8.1+
|
@@ -180,7 +167,7 @@ $user = User::fromArray([
|
180 | 167 | ]);
|
181 | 168 | ```
|
182 | 169 |
|
183 |
| -And thats it, no special getters or setters, no "behaviours" or extra code, smart entity casts everything automatically. |
| 170 | +And that's it, no special getters or setters, no "behaviours" or extra code, smart entity casts everything automatically. |
184 | 171 | More about Entity and supported auto casting types you can find [here](doc/entity.md).
|
185 | 172 |
|
186 | 173 | ## License:
|
|
0 commit comments