2007 - Rob Pike and Ken Thompson think it would be really cool if C was more like Java, and that it would be even more cool if it used the Pascal-style “x := 5” syntax. They lock themselves in a dark room over the winter and create Go. People criticize it for not being more like Rust, despite Rust not having been invented yet.
2009 - After an airplane crash leaves Graydon Hoare stranded in the middle of the Arabian desert, a mysterious camel appears and saves his life. He creates Rust, and adds obtuse syntax and a merciless compiler to mimic the feeling of being stranded in the desert. Masochists worldwide rejoice.
2012 - Anders Hejlsberg discovers some mushrooms growing from the base of his bathtub. After consuming them, he has a revelation that C# needs more Javascript. He invents Typescript. Typescript is a relatively verbose, garbage collected, class based, statically typed, single dispatch, object oriented language with single implementation inheritance and multiple interface inheritance. Microsoft loudly heralds Typescript’s novelty.
Hello. Appreciate your question. I think that this is a good use case for the Repository Pattern.
In your case, this might look something like this:
You can consult the Design Patterns / Gang of Four book for more details
Off topic, but personally I don’t feel you should worry too much about having to change the database in the future. I have rarely seen it happen in my career.