News for hackers. Stuff that matters.
Re:Embracing SQL in Postgres by JustSomeNobody on Thursday February 26, 2015 @11:47AM (#9113456)
I always hear (one of) the argument for ORMs being "If I want to switch databases...", but in reality, after having questioned many many devs, nobody has ever _actually_ done this.
Re:Embracing SQL in Postgres by spamizbad on Thursday February 26, 2015 @12:18PM (#9113630)
As one of the few devs who has actually switched databases (SQL Server to Postgres) -- without an ORM -- the biggest timesink was regression testing sanely and exporting/importing the data. Which you would have to do with an ORM anyway. The amount of time I spent re-writing a total of ~20 non-ANSI SQL queries and re-creating a handful of views (some of which were quite complex) was no more than 3 hours. And that would have gone by much faster had I been more familiar with Postgres at the time.
Re:Embracing SQL in Postgres by Demiurge on Thursday February 26, 2015 @01:09PM (#9114041)
> regression testing sanely and exporting/importing the data. Which you would have to do with an ORM anyway

You can export data into ORM specific, database agnostic format, such as Django fixtures or SQLAlchemy fixtures, and test against the ORM. This is actually one of the key ORM features to leverage.

Re:Embracing SQL in Postgres by Demiurge on Thursday February 26, 2015 @12:59PM (#9113952)
Pretty much ever other django project I work on starts with sqlite, on developers machine and only later gets migrated to PostgreSQL. I'm also dealing with legacy mysql website that didn't use ORM and I really wish they used an ORM. They hard coded column names, relationships, in absolutely most random places. Yes, this could be fixed with having better programmers, but if they used an ORM I could simply ignore a whole class of legacy!
Re:Embracing SQL in Postgres by acveilleux on Thursday February 26, 2015 @01:42PM (#9114306)
I dunno, I've seen ORM absolutely abused. Never underestimate the effect a tool can have in the hands of a clueless person.

That said, there are probably fewer SQL injections in ORM code than typical mysql messes.

Re:Embracing SQL in Postgres by simcop2387 on Thursday February 26, 2015 @12:44PM (#9113816)
My previous company is actually in the process of switching from Oracle to MySQL. That said doing so is of nightmarish proportions because they have 10-15 years of legacy behind them of building their own ORM, using a modern one and just raw Oracle-SQL (no ANSI joins there!) to either replace, rewrite or drop.
Re:Embracing SQL in Postgres by spacemanmatt on Thursday February 26, 2015 @06:14PM (#9116228)
Oracle -> MySQL? You have my most profound sympathies. Even before the ORM nonsense.
Re:Embracing SQL in Postgres by ChuckMcM on Thursday February 26, 2015 @03:16PM (#9115169)
We switched from MySQL to Postgres on our analytics database and it would have been a lot easier with an ORM.
Re:Embracing SQL in Postgres by dennisgorelik on Thursday February 26, 2015 @09:38PM (#9116883)
How do you know it would have been easier with ORM?

I'm looking for a single example of ORM-based project switching RDBMS. It looks like it almost never happens.