Skip to main content

Posts

Showing posts from August, 2019

Set execute permission with Git from Windows

At my work, I am working usually with Windows. But when we started our migration to Linux Docker containers and Kubernetes, I've found one annoying issue. Once you create a bash file on Windows, push it to Git and after this, you try to execute this file in most cases, you will get a “Permission Denied” error.

Pros and cons of different ways of storing Enum values in the database

Lately, I was experimenting with Dapper for the first time. During these experiments, I've found one interesting and unexpected behavior of Dapper for me. I've created a regular model with string and int fields, nothing special. But then I needed to add an enum field in the model. Nothing special here, right? Long story short, after editing my model and saving it to the database what did I found out? By default Dapper stores enums as integer values in the database (MySql in my case, can be different for other databases)! What? It was a surprise for me! (I was using ServiceStack OrmLite for years and this ORM by default set's enums to strings in database) Before I've always stored enum values as a string in my databases! After this story, I decided to analyze all pros and cons I can imagine of these two different ways of storing enums. Let's see if I will be able to find the best option here.