In an ORM you can have nice syntax like this:
my $results = Model.objects.all()[10];
And in the Django ORM it even quite nicely handles foreign key relationships and many to many relationships all through the ORM.
However, in MySQL you can run a query like this:
SELECT t1.column1
, t2.column2
, t3.column3
FROM db1.table AS t1
, db2.table AS t2
, db3.table AS t3
WHERE t1.id = t2.t1_id
AND t1.id = t3.t1_id
LIMIT 0,10
I'm looking for an ORM that can support these types of query natively but can't really see anything that does.
Are there any existing ORMs that can do this? Or are there alternative strategies for tackling this problem?
Whenever I've used a framework like django to build a site, I've kept everything on the same database because I was aware of the limitation. Now I'm working with data that's spread across many different databases, for no apparent reason other than namespacing.