tatitati / orm_lab

Learning project around ORM to make experiments and get some more knowledge

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Roadmap

  • Create unidirectionals and bidirectionals relations
  • Add custom mapping types (address)
  • Add multiple entity managers
  • Create test database (multiple environments)
  • Investigate how to reference another aggregate only by id rather than by reference
  • Add doctrine cache
  • Investigate migrations for test database (to keep sync)

Setup

env database

bin/console doctrine:database:drop --force
bin/console doctrine:database:create
bin/console doctrine:schema:create

test database

bin/console doctrine:database:drop --force --env=test
bin/console doctrine:database:create --env=test
bin/console doctrine:schema:create --env=test

Examples

Some stuff to play with dev database:

bin/console doctrine:query:sql "select * from user"
bin/console doctrine:query:dql --max-result 1 "select u from App\Entity\PersistenceModel\User u Where u.name='Francisco'" --hydrate array
bin/console doctrine:query:dql --max-result 1 "select u from App\Entity\PersistenceModel\User u Where u.name='Francisco'" --hydrate object

Same with test database:

bin/console doctrine:query:sql "select * from user" --env=test

About

Learning project around ORM to make experiments and get some more knowledge


Languages

Language:PHP 100.0%