In this blog post, we will address how to seed your Postgres Database when using FluentMigrator. In the example context, we have a Postges Database running on a docker container, and have a Web Api connecting to the database using Dapper. Dapper is a micro-orm, and while it is pretty good in what is does, … Continue reading Seed Postgres Database with FluentMigrator
Category: Database
MongoDb, Docker and Compass
The other day I struggled a bit in setting up MongoDb in a docker container and then connecting it with Compass - the MongoDb client. That's when I thought I would document the knowledge here so that anyone else who run into similar problems could look into it (and also in case I forget later, … Continue reading MongoDb, Docker and Compass
The Last Non-Null Value Problem
I recently came across a problem with a query in Sql Server which I thought about sharing in my blog as this could be useful to many. Following is a summary of the problem. A similar problem is discussed in the Blog Entry First Non Null Puzzle by Itzik Ben-Gan. But my own problem had a little … Continue reading The Last Non-Null Value Problem
Cheat Code for Database Meta information : PostgreSql
In an earlier post we looked at the Queries for Sql Server for retrieving meta information. In this post, we will look at the PostgresSql version. Get All Views SELECT table_name, view_definition FROM information_schema.VIEWS WHERE table_schema = ANY ( Current_schemas(FALSE) ); Get All Tables SELECT table_name FROM information_schema.TABLES WHERE table_schema = ANY ( Current_schemas(FALSE) ) Get All … Continue reading Cheat Code for Database Meta information : PostgreSql
Cheat Code for Database Meta information : Sql Server
This post acts as a quick reference/Cheat code for anyone who would like to query the meta information about different entities in a database using Sql Server. Get all Views in the Database SELECT NAME, Object_definition (Object_id(NAME)) FROM sys.views Get All Tables in the Database SELECT NAME FROM sys.tables Get all columns from a table … Continue reading Cheat Code for Database Meta information : Sql Server
MongoDb 002 : CRUD – Part 1
We will continue with our exploration of MongoDb in this second part of tutorial, working our CRUD examples. Let's beging with the 'C'. In order to create a document, you would need to use, as you can guess, the Insert command. Notice that we are using a new collection named subject here. MongoDb would automatically … Continue reading MongoDb 002 : CRUD – Part 1
MongoDb 001 : Basic Commands
Before we actually get into MongoDb, let's begin by importing a Test Db. You can access the JSON file here. Once you have downloaded the file, use following command to import the document into mongodb. Let's break it down, the command tells you to import a file students.json into a database called testdb and collection … Continue reading MongoDb 001 : Basic Commands
MongoDb : Beginners Guide
MongoDb is definitely fascinating, and it is here to stay, there is no doubts about it. Here is my attempt to put together a small series of tutorial for beginners. Probably sometime down the line, I will put together a beginners guide on some other NoSql Db as well, but here is one for MongoDb, … Continue reading MongoDb : Beginners Guide
Workaround for MySql 5.7 EF DbFirst Issue
Anyone working on .Net application with MySql 5.7 and EF in Db First Approach would have come across what is an officially confirmed bug. This bug rises when you attempt to generate/update your Entity Model after changes to the Database. "Unable to generate the model because of the following exception: 'System.Data.StrongTypingException: The value for column … Continue reading Workaround for MySql 5.7 EF DbFirst Issue
Appending Strings and Parameters in Firebird.
One of the issues I recently faced while working with Firebird was how to use a string within a 'Execute Statement'. For example, This throws an error. though the answer looked farely simple when done. You need to two Single Quotes. There might be another situation, when you need to append string based on … Continue reading Appending Strings and Parameters in Firebird.