sql-server+sf=what

How about… Symfony and SQL Server?

In every domain of life, people are able to point out some sort of coexistence. What I mean is some things or organisms co-exist and will always exist one next to each other. It relates to living creatures such as i.e. tree and mycelium or whale and small fish. People generate such coexistence in what they create too. And one of the best examples is IT. Technologies coexist on to each other, they keep some sort of schemas. For example, LAMP stack – Linux Apache MySQL and PHP.
But sometimes developers are pushed to mix some technologies which are not really meant to coexist. Thus I mean i.e. SQL Server and Symfony – php microframework.

What did happen?

In one of projects I work on currently there is a need to use SQL Server, because of legacy – client has a server with Windows Server 2012 and uses SQL Server 2017 to store data. On another hand, there is a need to build a new solution quickly and deploy it at once. So the best choice is Symfony 4 and Sonata 3 – ready to use views, easy to customize and… support for SQL Server. It seems so easy, you would say. And from here – it just gets worse.

So… why it is so wrong?

It is neither the fault of SQL Server, nor Symfony’s fault. As well as SQL Server is powerful and very well designed software, that Symfony is too. It is just the thing about nobody really has ever thought of those two technologies coexisting. However, they can.
Everything from the very beginning of integration process is a little bit longer. Installation of drivers is more complicated; it is not difficult it just has more steps and more software to be installed. After that, some would be distracted with a tone of errors while migrating anything using Doctrine 2, so you have to force Doctrine to push migrations through. And last thing, little one, but kind of annoying – Doctrine is not really able to “lint and correct” mistakes in queries. Driver somehow does not allow ORM to escape characters or detect prohibited usage of reserved phrases.

All this does not make this co-existence unacceptable. I would rather say that it is just a little bit harsh.

And for those who would like some sources as a kind of argumentation of my words, here it comes:

  • My own issue on MS Docs on GitHub – an issue where I pointed out possible difficulties while installing drivers connected to MS docs,
  • Doctrine DBAL docs – configuration doc page where it is stated that actually there are two drivers, both are, like, parallel to each other, but one for Doctrine does not really work…

If I was telling something totally senseless, nobody would care about it on MS docs and there would be no bolded message on Doctrine documentation.

And to tell the truth, it is not that bad. After first difficulties, it gets easier, but you can always choose even easier way and use MySQL or PGSQL.

Greetings folks and thanks for reading!

Leave a Comment

Your email address will not be published. Required fields are marked *