feat: initial commit of camelia/orm

Attribute-mapped Active Record ORM for MariaDB/MySQL over PDO.

- Attribute-driven metadata: TableName, PrimaryKey, AutoIncrement, Column,
  Guarded, Ignore, Required, Enum, Nullable, Length, Precision, Unique,
  UniqueGroup, Index, MaxLength.
- Relationship mapping: BelongsTo, HasOne, HasMany, BelongsToMany with
  batched eager loading and a 3-level depth limit.
- Orm entry point with fromArray, fromPdo, fromEnv and nested transactions.
- Immutable Query with Cond operators and GroupCond grouping.
- Repository read and write API, pagination, and typed exception hierarchy.
- Declares PHP >=8.3; Mago and PHPStan pin the parser to 8.3.
- MIT license.
This commit is contained in:
dgarcia committed 2026-11-15 10:14:22 -03:00
commit 66e93e3070
97 files changed
+12188

No files matched your search

+75
View File
@@ -0,0 +1,75 @@
{
"name": "camelia/orm",
"description": "Lightweight attribute-mapped Active Record ORM for MariaDB/MySQL over PDO.",
"type": "library",
"license": "MIT",
"keywords": ["orm", "activerecord", "pdo", "mysql", "mariadb"],
"authors": [
{
"name": "Dario Garcia",
"email": "dario61081@gmail.com"
}
],
"require": {
"php": ">=8.3",
"ext-mbstring": "*",
"ext-pdo": "*",
"psr/log": "^3.0"
},
"require-dev": {
"carthage-software/mago": "^1.60",
"phpstan/phpstan": "^1.11",
"phpunit/phpunit": "^10.5 || ^11.0"
},
"suggest": {
"brick/math": "Support for BigDecimal-mapped properties"
},
"autoload": {
"psr-4": {
"Camelia\\Orm\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Camelia\\Orm\\Tests\\": "tests/"
}
},
"scripts": {
"test": "phpunit --configuration phpunit.xml.dist",
"test:integration": "phpunit --configuration phpunit.integration.xml.dist",
"fmt": "mago fmt",
"fmt:check": "mago fmt --check",
"lint": "mago lint",
"analyze": "mago analyze",
"phpstan": "php -d memory_limit=1G vendor/bin/phpstan analyse --configuration phpstan.neon --no-progress",
"check": [
"@fmt:check",
"@lint",
"@analyze",
"@phpstan",
"@test"
]
},
"config": {
"sort-packages": true
},
"minimum-stability": "stable",
"prefer-stable": true,
"archive": {
"exclude": [
"/tests",
"/mago-baseline.toml",
"/mago.toml",
"/phpstan.neon",
"/phpunit.integration.xml.dist",
"/phpunit.xml.dist",
"/AGENTS.md",
"/.gitignore"
]
},
"extra": {
"branch-alias": {
"dev-main": "1.0.x-dev"
}
}
}