added mq and database connected funcs and endpoint

This commit is contained in:
0xdcarns
2023-02-06 12:09:21 -05:00
parent f4851937c1
commit 7a2c225eb1
6 changed files with 61 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ var SQLITE_FUNCTIONS = map[string]interface{}{
DELETE_ALL: sqliteDeleteAllRecords,
FETCH_ALL: sqliteFetchRecords,
CLOSE_DB: sqliteCloseDB,
isConnected: sqliteConnected,
}
func initSqliteDB() error {
@@ -135,3 +136,8 @@ func sqliteFetchRecords(tableName string) (map[string]string, error) {
func sqliteCloseDB() {
SqliteDB.Close()
}
func sqliteConnected() bool {
stats := SqliteDB.Stats()
return stats.OpenConnections > 0
}