Bash based Busy Handler for Sqlite

Sqlite is a serverless database and hence doesn’t allow multiple synchronous write requests. Sqlite API for most programming languages have a busy handler functionality which lets you define a busy handler function or a timeout value, thus enabling your program to wait for a certain amount of time and then access the database again.
However no such functionality exists when you want to use sqlite through a bash script. Hence I implemented a pseudo busy handler for bash scripts.

This script allows you to use the $DB_COMMAND variable just like you would use the sqlite3 utility, no changes in syntax. When the DB is found busy, it will sleep for 1 second and try again till it can successfully access the DB.