Now defining ::rivet::lempty if not available
diff --git a/ChangeLog b/ChangeLog
index bb58d5b..2a220dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-10-02 Massimo Manghi <mxmanghi@apache.org>
+	* rivet/packages/dio/dio.tcl: definining command ::rivet::lempty if not present
+	as it's extensively used but available only when running from mod_rivet (DIO
+	package version number bumped to 1.2.1)
+
 2025-08-19 Massimo Manghi <mxmanghi@apache.org>
 	* src/mod_rivet_ng/rivet_types.h,src/parser/rivetParser.c: Introducting definition
 	of Tcl_Size when TCL_MAJOR_VERSION == 8 in order to provide backward compatibility
@@ -5,7 +10,8 @@
 
 2025-07-13 Massimo Manghi <mxmanghi@apache.org>
 	* rivet/packages/dio/dio_Tdbc.tcl: fixed error in variable name made impossible
-	to actually pass TDBC specific options to a DBMS connector. Package version is bumped to 1.2.1
+	to actually pass TDBC specific options to a DBMS connector. Package version is
+	bumped to 1.2.1
 
 2025-05-05 Massimo Manghi <mxmanghi@apache.org>
 	* VERSION: Version 3.3.0. Merging tcl-novem into master after branching current
diff --git a/rivet/packages/dio/dio.tcl b/rivet/packages/dio/dio.tcl
index d45cf33..d841413 100644
--- a/rivet/packages/dio/dio.tcl
+++ b/rivet/packages/dio/dio.tcl
@@ -18,6 +18,22 @@
 package require Itcl
 package require dio::formatters
 
+# Command ::rivet::lempty is extensively used within this class but it's
+# defined only when we run DIO from mod_rivet. We load it here for convenience
+
+if {[info commands ::rivet::lempty] == ""} {
+
+    namespace eval ::rivet {
+
+        proc lempty {list} {
+            if {[catch {llength $list} len]} { return 0 }
+            return [expr {$len == 0}]
+        }
+
+    }
+
+}
+
 ##set auto_path [linsert $auto_path 0 [file dirname [info script]]]
 
 namespace eval ::DIO {
@@ -908,4 +924,4 @@
 
 } ; ## namespace eval DIO
 
-package provide DIO 1.2
+package provide DIO 1.2.1