In doctrine1 it was possible to generate-models-db. How to do that in doctrine2 from cli?
I end up implementing new command https://github.com/umpirsky/doctrine2/blob/master/lib/Doctrine/ORM/Tools/Console/Command/GenerateEntitiesDbCommand.php :)
Later, I realized you can
php doctrine orm:convert-mapping --from-database yml /path/to/mapping-path-converted-to-yml
Related
Is there a specific way to use sqlite3 in symfony without using doctrine?
I just want to do basic operations. And tried including the classes in the directory structure but it is not able to find SQLite3 class.
Any suggestions? I am very tight on time constraint.
Doctrine allow to use sqlite if you define path in doctrine dbal in config.
How to use sqlite database on symfony2 project?
but Doctrine is not integral part of Symfony, so you can drop Doctrine from your project and use sqlite like in pure Php.
You can use exaples form docs:
http://php.net/manual/en/book.sqlite3.php
proposed by Jason Roman in comment. It is simple, but I suggest to create your own service for operation on sqlite or simply use PDO.
http://php.net/manual/en/ref.pdo-sqlite.php
I have a large number of CakePHP 2 web applications, many of them use remote data over the custom DataSource. I'm reading the documentation of CakePHP 3, but I can not find instructions for creating custom datesource.
My next project also requires a custom DataSource (ArangoDB), so I planned to build it with the new version of CakePHP.
Please do specify where and how to build a DataSource in CakePHP 3.
Thank You.
Just look at the code of any existing database driver and see how it is built? There is nothing in the book yet about how to create your own datasource.
ArangoDB seems to be yet another NoSQL DB, so take a look at how this Elastic Search datasource is done. By a quick look I think you can use it as a base for your implemention, they seem to be similar.
I was facing the same problem so I decided to write my own models in CakePHP 3.x. If you want you can use it from here. hope you like it.
that would be the 'correct' place/way to use? Still very new... Basically trying to port an app to CakePHP and update it. A lot of the functionality of the program is in bash scripts.
Like what CakePHP has forced me to learn regarding MVC model, and couldn't find really any info on proper way to use bash scripts.
Thanks!
app/Console would be the appropriate location.
I need to fetch database comments from a postgresql using hibernate. I have read the documentation but could not find any hints on how to get the comments. Basically I am generating Pojos and would like to use the comments in the database to put them into the Java classes.
Thanks in advance!
I seems hibernate does fetch DB comments when using the hbm2hbmxml tool but is not using that when generating POJOs (hbm2java). You can override the freemarker templates used to generate POJOs and add the comments there.
I'm working on project and need to implement custom database driver, but can't find any guidelines which interfaces i should to implement.
Is there any resourses available that could help writing custom driver rather thank just diving in code and trying to figure out how current drivers are implemented?
EDIT
By saying "driver" i mean support for example NoSQL dabase using standart Laravel's methods ( Eloquent model and Query builder ), for example:
User::take(10)->get();
For Mysql Laravel uses eloquent
laravel - eloquent
For NoSql like MongoDB, you can use laravel-mongodb
jenssegers - laravel-mongodb
It's even support Hybrid relations between MySql and MongoDB
I have worked on MongoDB (a NoSQL database) in one of my project, where I have to use a jenssengers package https://github.com/jenssegers/laravel-mongodb to use the functionalities. I was not able to use Eloquent in that.
Laravel - eloquent/ jenssegers - Laravel-MongoDB can manage hybrid relations as well.