Simple prevent write commands in SQL Server

On multiple occasions, I found myself trying to check if a query for data read is safe to execute or not. This is typically useful when the query is saved outside of your code, and you cannot restrict the access level of the user executing it. The following regex, while not exhausting by any means, will detect most query patterns typically used to change data. Note that inserts, updates, deletes, and merges are permitted on temporary tables (e....

May 25, 2021 · 1 min · LPains

Date input placeholder hack

The input type date is a very nice control introduced in HTML5. The problem is that it is very limited at this point and features such as placeholder may not available. Regardless, you may use it successfully if you are willing to make some css adjustments. In this post I will show how to add a placeholder to a date editor using minimal javascript and css. For the demo below I’m using vanilla css and vuejs just because it is so easy to use....

February 5, 2021 · 1 min · LPains

Xamarin Forms Collection View Multi-Selection Binding

I spent a few too many hours fiddling with Xamarin Form’s collection view and multi-selection binding. That was somewhat frustrating so I’m writing a little about it in the hopes that you don’t have to deal with the same. If you have a view like this: and a View Model like this: You’d expect the binding to work, right? No problems. Well, no. It doesn’t. The CollectionView will only bind SelectedItems to collections of object....

November 1, 2020 · 1 min · LPains

Automatic release notes on Azure DevOps - an update

6 months ago I posted about Automatic release notes on Azure DevOps. Since then, I was able to make the process a little more centric to Pull Requests and avoid the occasional incorrect work item showing up in the release notes. The primary difference is that we will use the new Cross Platform Generate Release Notes task instead of the original Powershell based task. This updated version offers a little more control via handlebars extensions that can help us filter out the undesired work items....

October 27, 2020 · 2 min · LPains
Dashboard

Enforce read only access in SQL Server queries

This is not something common, I guess. Imagine with me, will you? You have an app dedicated for reporting. The sole reason you built this app is to allow non-developers, but data savvy people, to create operational reports for LOB applications. How do you ensure that your users will not use this solution to modify data on the fly? Imagine how fun would it be to explain why your reporting solution allow them to modify data to your boss....

July 7, 2020 · 2 min · LPains