Kagunda JM

/ Software Developer /

Add Snowpack to ASP.NET Core Web App

Introduction I stumbled on Snowpack while searching for a solution to resolve a ParcelJS error. Building my application assets with ParcelJS worked without errors but when running the application, none of the JS scripts were running. Upon checking the browser console window, I was getting the following error: Uncaught (in promise) Error: Cannot find module. I never managed to resolve the error but Snowpack appeared in one of the searches.

The Data Directory Contains an Old postmaster.pid File

PostgreSQL Connection Failure Sometimes, computers have a life of their own. You shut down your laptop and on the next boot, you are unable to connect to a PostgreSQL 12 database. Opening the installed Postgres.app, I notice it displays stale postmaster.pid file error. Postmaster.pid What the heck is the postmaster.pid file? Turns out that the postmaster.pid is a lock file used to prevent two instances of the same PostgreSQL server from running on the same data-directory.

How To Alter a Column Used By A View or Rule

In PostgreSQL, assume you have a table and view with the following definitions: CREATE TABLE boq_items ( id character varying(22) NOT NULL, item_no character varying(50) NOT NULL, activity_name character varying(255) NOT NULL, page_no int NOT NULL, qty numeric(14,2) NOT NULL, rate numeric(14,2) NOT NULL, bq_amt numeric(14,2) NOT NULL ); CREATE VIEW vw_boq_item_names AS SELECT activity_name FROM boq_items; Attempting to change the definition of activity_name column using ALTER TABLE boq_items ALTER activity_name TYPE text, ALTER activity_name SET NOT NULL; will return a cannot alter type of a column used by a view or rule.

How to Drop All Tables in PostgreSQL Database

Introduction The DROP TABLE command in PostgreSQL removes a table definition, all data and indexes of a table from a database. DROP TABLE will fail if the table has other objects that depend on it like views and foreign key definitions. The command will also fail and display a table does not exist message if the table being dropped does not exist. PostgreSQL does not have a drop all tables command and you have to define your own way of performing this task.

How To Integrate Asp.NET Core Project with Bootstrap, TailwindCSS and ParcelJS

Introduction When you create a new ASP.NET Core Razor Pages project, the new project comes bundled with Bootstrap CSS framework and jQuery Javascript library. Files for both Bootstrap and jQuery are placed in a wwwroot/lib folder. The lib folder contains both compressed and un-compressed versions of all files your project may require. During development, you add more CSS to customize the design of your final application. At times, the CSS you add may end up duplicating formatting under different class names.