Fuzzy rank based relevant search in PostgreSQL.
In this article, I'll share how I've improved a search feature by ranking fuzzy string matches by applying
to_tsvector, phraseto_tsquery, ts_rank, similarity to the searched term.
let's say we need to search list of labs which name contains the character combination of 'medwhite'.
I'm saying contains since there might be names that are not an
Date: August 14, 2023, 9:54 am Author: Akram Hossain
Postgresql find foreign key references and reset primary key serial without truncate table
in this blog post i will try to explain how to find Postgresql foreign key references and reset primary key serial.
now question is why we need to find Postgresql foreign key references and reset primary key serial ?
sometime we have a scenerio where we need to reset the primary key for business need at
Date: July 22, 2022, 8:57 am Author: Akram Hossain
Below is the example of how to write CASE Statement & Nested Case in SQLSELECT
when order_items.vat_charges > 0 then (order_items.price * order_items.quantity)/(1+(order_items.vat_charges/100))
else (order_items.price * order_items.quantity)
end as website_price_total,
when shops.shop_id = 24 then
when order_items.vat_charges > 0 then (order_items.cost_price * o
Date: February 21, 2022, 5:19 am Author: Akram Hossain
Razorpay is the only payments solution in India that allows businesses to accept,
process and disburse payments with its product suite.
It gives you access to all payment modes including credit card, debit card, netbanking,
UPI and popular wallets including JioMoney, Mobikwik, Airtel Money, FreeCharge, Ola Money and PayZapp.
Now we will try to integrate Razorpay in Yii2 application.
Date: December 28, 2021, 12:58 pm Author: Akram Hossain
To filter relational table in TypeORM using findAndCount there is a workaround. To filtering based on relation fields for findAndCount.
We need to use ObjectLiteral-style where using this style conditions are works perfectly.
Assume that we have Three entities – products,attributeSet and woodType. products belongs to one attributeSet and one woodType,
attributeSet and woodType has many prod
Date: July 17, 2020, 10:46 am Author: Akram Hossain
Virtual column in MySQL is generated column, this column data or value comes from expression or function or other columns.
The difference between virtual column and normal column is normal table column value saved to disk
but virtual column value generated dynamically from any expression or function or from other columns.
So the virtual column has following characteristics
Virtual column is
Date: July 22, 2015, 11:11 am Author: Akram Hossain
In this tutorial we will learn how to create md5 hash in java. To create md5 hash in java we need follow below steps.
Create MessageDigest object for MD5
Update input string in message digest
Converts message digest value in base16 (hex)
If md5 generated successfully return md5
Date: June 18, 2014, 10:40 pm Author: Akram Hossain
For connecting to MySQL database using java we need to do following.
Java driver class name for MySQL: com.mysql.jdbc.Driver
Database connection string or connection url: jdbc:mysql://localhost:3306/addressBook
jdbc is the api name.
mysql is the database managment software.
localhost is the name of server where MySQL is installed.
3306 is the port port number.
addressBook is the name of d
Date: June 18, 2014, 10:37 pm Author: Akram Hossain
In this article i will explain how to export MySQL table data to csv file. To export data to csv at first we need to connect our application to MySQL.
You can follow this tutorial to learn How to connect to MySQL database in java.
We need to follow these steps in order to export data to csv.
Connect to MySQL.
Use FileWriter Class.
Get Data from MySQL table.
Append data to csv file
Date: June 18, 2014, 10:25 pm Author: Akram Hossain