You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tcl.apache.org by mx...@apache.org on 2025/10/06 09:18:56 UTC
(tcl-rivet) branch 3.2 updated (da24aac -> bfe6ca6)
This is an automated email from the ASF dual-hosted git repository.
mxmanghi pushed a change to branch 3.2
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git
from da24aac dio_Tdbc package version bumped as 1.2.1
new 9b8a994 Now defining ::rivet::lempty if not available
new 0bc6edf Fix sqlite3 connection creation, add mariadb and sqlite aliases, filtering unrecognized driver names
new 948b050 properly handle sqlite3 connection, fixed severe bug in arguments being passed to special fields formatter
new 60c5c8d fix wrong class names in comment
new bfe6ca6 version bumped to 3.2.7
The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
ChangeLog | 36 +++++++++++++++++++--
VERSION | 2 +-
rivet/packages/aida/aida.tcl | 10 +++---
rivet/packages/aida/formatters.tcl | 54 ++++++++++++++++++++++++++++++++
rivet/packages/dio/dio.tcl | 20 ++++++++++--
rivet/packages/dio/dio_Tdbc.tcl | 39 ++++++++++++++++++-----
rivet/packages/dio/formatters.tcl | 16 +++++-----
rivet/packages/dio/pkgIndex.tcl | 2 +-
rivet/packages/session/session-class.tcl | 20 ++++++------
9 files changed, 163 insertions(+), 36 deletions(-)
create mode 100644 rivet/packages/aida/formatters.tcl
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tcl.apache.org
For additional commands, e-mail: commits-help@tcl.apache.org
(tcl-rivet) 01/05: Now defining ::rivet::lempty if not available
Posted by mx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mxmanghi pushed a commit to branch 3.2
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git
commit 9b8a994f35b86aa57fc35d2fb50835ba8b0e418c
Author: Massimo Manghi <ma...@gmail.com>
AuthorDate: Thu Oct 2 11:21:11 2025 +0200
Now defining ::rivet::lempty if not available
---
ChangeLog | 21 +++++++++++++++++++--
rivet/packages/dio/dio.tcl | 18 +++++++++++++++++-
2 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index f6439e0..57b65f1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,23 @@
+2025-10-02 Massimo Manghi <mx...@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 <mx...@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
+ with Tcl 8 builds
+
2025-07-13 Massimo Manghi <mx...@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 as 1.2.1
+ * 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
+
+2025-05-05 Massimo Manghi <mx...@apache.org>
+ * VERSION: Version 3.3.0. Merging tcl-novem into master after branching current
+ Tcl8.6 only development to branch 3.2. Development continues on a Tcl9 ready master branch
+ * rivet/packages/aida: reset development with the purpose of refactoring
+ DIO and rebase the code on TclOO supporting only tdbc connectors
2025-04-13 Massimo Manghi <mx...@apache.org>
* src/Makefile.am: wrap long definitions for improved readability
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 @@ catch {package require Tclx}
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 @@ proc handle {interface args} {
} ; ## namespace eval DIO
-package provide DIO 1.2
+package provide DIO 1.2.1
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tcl.apache.org
For additional commands, e-mail: commits-help@tcl.apache.org
(tcl-rivet) 05/05: version bumped to 3.2.7
Posted by mx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mxmanghi pushed a commit to branch 3.2
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git
commit bfe6ca67339a0fd024eb70f9292f226731e6812d
Author: Massimo Manghi <mx...@apache.org>
AuthorDate: Mon Oct 6 11:18:45 2025 +0200
version bumped to 3.2.7
---
ChangeLog | 3 +++
VERSION | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index e9954d6..2bc79c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+2025-10-06 Massimo Manghi <mx...@apache.org>
+ * VERSION: bumped version 3.2.7 in branch 3.2
+
2025-10-05 Massimo Manghi <mx...@apache.org>
* rivet/packages/dio/[dio|dio_Tdbc.tcl|formatters.c]: fix missing argument
in field formatter call
diff --git a/VERSION b/VERSION
index 406ebcb..f092941 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.2.7
+3.2.8
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tcl.apache.org
For additional commands, e-mail: commits-help@tcl.apache.org
(tcl-rivet) 03/05: properly handle sqlite3 connection, fixed severe bug in arguments being passed to special fields formatter
Posted by mx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mxmanghi pushed a commit to branch 3.2
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git
commit 948b0508e2a74878866c8ee9055c590d32114d42
Author: Massimo Manghi <ma...@gmail.com>
AuthorDate: Mon Oct 6 10:52:34 2025 +0200
properly handle sqlite3 connection, fixed severe bug in arguments being passed to special fields formatter
---
ChangeLog | 14 ++++++++++----
rivet/packages/dio/dio.tcl | 2 +-
rivet/packages/dio/dio_Tdbc.tcl | 1 +
rivet/packages/dio/formatters.tcl | 12 ++++++------
rivet/packages/session/session-class.tcl | 20 +++++++++++---------
5 files changed, 29 insertions(+), 20 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 9a3a48c..e9954d6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,8 +1,14 @@
+2025-10-05 Massimo Manghi <mx...@apache.org>
+ * rivet/packages/dio/[dio|dio_Tdbc.tcl|formatters.c]: fix missing argument
+ in field formatter call
+ * rivet/packages/session/session-class.tcl: add debug output method to allow
+ overriding of it
+
2025-10-03 Massimo Manghi <mx...@apache.org>
- * rivet/packages/dio/dio_Tdbc.tcl: restricting constructor action on the set of tdbc
- known drivers. Creating 'mariadb' and 'sqlite' aliases for mysql and sqlite3
- respectively. Adopting a specific tdbc connector creator form when creating a
- sqlite3 handle
+ * rivet/packages/dio/dio_Tdbc.tcl: restricting constructor action on the set of tdbc
+ known drivers. Creating 'mariadb' and 'sqlite' aliases for mysql and sqlite3
+ respectively. Adopting a specific tdbc connector creator form when creating a
+ sqlite3 handle
2025-10-02 Massimo Manghi <mx...@apache.org>
* rivet/packages/dio/dio.tcl: definining command ::rivet::lempty if not present
diff --git a/rivet/packages/dio/dio.tcl b/rivet/packages/dio/dio.tcl
index d841413..8ab32e0 100644
--- a/rivet/packages/dio/dio.tcl
+++ b/rivet/packages/dio/dio.tcl
@@ -654,7 +654,7 @@ proc handle {interface args} {
}
public method makeDBFieldValue {table_name field_name val {convert_to {}}} {
- return [$this build_special_field $table_name $field_name $val]
+ return [$this build_special_field $table_name $field_name $val $convert_to]
}
##
diff --git a/rivet/packages/dio/dio_Tdbc.tcl b/rivet/packages/dio/dio_Tdbc.tcl
index 98eed2b..2ef78c4 100644
--- a/rivet/packages/dio/dio_Tdbc.tcl
+++ b/rivet/packages/dio/dio_Tdbc.tcl
@@ -37,6 +37,7 @@ namespace eval DIO {
-timeout]
constructor {interface_name args} {eval configure -interface $interface_name $args} {
+ set connector_n 0
set connector ""
# I should check this one: we only accept connector
diff --git a/rivet/packages/dio/formatters.tcl b/rivet/packages/dio/formatters.tcl
index 7bc16bf..c2b17b5 100644
--- a/rivet/packages/dio/formatters.tcl
+++ b/rivet/packages/dio/formatters.tcl
@@ -79,12 +79,12 @@ namespace eval ::DIO::formatters {
public method NOW {field_name val convert_to} {
- # we try to be coherent with the original purpose of this method whose
- # goal is endow the class with a uniform way to handle timestamps.
- # E.g.: Package session expects this case to return a timestamp in seconds
- # so that differences with timestamps returned by [clock seconds]
- # can be done and session expirations are computed consistently.
- # (Bug #53703)
+ # we try to be coherent with the original purpose of this method whose
+ # goal endows the class with a uniform way to handle timestamps.
+ # E.g.: Package session expects this case to return a timestamp in seconds
+ # so that differences with timestamps returned by [clock seconds]
+ # can be done and session expirations are computed consistently.
+ # (Bug #53703)
switch $convert_to {
SECS {
diff --git a/rivet/packages/session/session-class.tcl b/rivet/packages/session/session-class.tcl
index 1a047a2..f3ffebd 100644
--- a/rivet/packages/session/session-class.tcl
+++ b/rivet/packages/session/session-class.tcl
@@ -17,7 +17,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-package provide Session 1.0
+package provide Session 1.0.1
package require Itcl
::itcl::class Session {
@@ -103,9 +103,9 @@ package require Itcl
public variable debugMode 1
constructor {args} {
- eval configure $args
+ eval configure $args
$dioObject registerSpecialField $sessionTable session_update_time NOW
- $dioObject registerSpecialField $sessionTable session_start_time NOW
+ $dioObject registerSpecialField $sessionTable session_start_time NOW
}
method status {args} {
@@ -192,10 +192,10 @@ package require Itcl
#
method set_session_cookie {value} {
::rivet::cookie set $cookieName $value \
- -path $cookiePath \
- -minutes $cookieLifetime \
- -secure $cookieSecure \
- -HttpOnly $cookieHttpOnly
+ -path $cookiePath \
+ -minutes $cookieLifetime \
+ -secure $cookieSecure \
+ -HttpOnly $cookieHttpOnly
}
#
@@ -494,9 +494,11 @@ package require Itcl
#
method debug {message} {
if {$debugMode} {
- puts $debugFile "$this (debug) $message<br>"
+ $this debug_output "$this (debug) $message" $debugFile
flush $debugFile
}
}
-}
+ method debug_output {msg args} { puts [lindex $args 0] "$msg <br>" }
+
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tcl.apache.org
For additional commands, e-mail: commits-help@tcl.apache.org
(tcl-rivet) 02/05: Fix sqlite3 connection creation, add mariadb and sqlite aliases, filtering unrecognized driver names
Posted by mx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mxmanghi pushed a commit to branch 3.2
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git
commit 0bc6edf0cc9ae9bafe4646594d125fde355aea8e
Author: Massimo Manghi <mx...@apache.org>
AuthorDate: Fri Oct 3 16:00:59 2025 +0200
Fix sqlite3 connection creation, add mariadb and sqlite aliases, filtering unrecognized driver names
---
ChangeLog | 6 ++++++
rivet/packages/dio/dio_Tdbc.tcl | 38 +++++++++++++++++++++++++++++++-------
rivet/packages/dio/pkgIndex.tcl | 2 +-
3 files changed, 38 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 57b65f1..9a3a48c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-10-03 Massimo Manghi <mx...@apache.org>
+ * rivet/packages/dio/dio_Tdbc.tcl: restricting constructor action on the set of tdbc
+ known drivers. Creating 'mariadb' and 'sqlite' aliases for mysql and sqlite3
+ respectively. Adopting a specific tdbc connector creator form when creating a
+ sqlite3 handle
+
2025-10-02 Massimo Manghi <mx...@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
diff --git a/rivet/packages/dio/dio_Tdbc.tcl b/rivet/packages/dio/dio_Tdbc.tcl
index 83c764c..98eed2b 100644
--- a/rivet/packages/dio/dio_Tdbc.tcl
+++ b/rivet/packages/dio/dio_Tdbc.tcl
@@ -21,7 +21,7 @@
package require tdbc
package require DIO 1.2
-package provide dio_Tdbc 1.2.1
+package provide dio_Tdbc 1.2.2
namespace eval DIO {
::itcl::class Tdbc {
@@ -29,6 +29,7 @@ namespace eval DIO {
private common connector_n 0
private variable connector
+ private variable connector_name
private variable tdbc_connector
private variable tdbc_arguments [list -encoding \
-isolation \
@@ -43,10 +44,28 @@ namespace eval DIO {
#puts "tdbc interface: $interface_name"
set connector_name [::string tolower $interface_name]
- if {$connector_name == "oracle"} {
- set connector_name "odbc"
- } elseif {$connector_name == "postgresql"} {
- set connector_name "postgres"
+ switch $connector_name {
+ "oracle" {
+ set connector_name "odbc"
+ }
+ "postgresql" {
+ set connector_name "postgres"
+ }
+ "sqlite" {
+ set connector_name "sqlite3"
+ }
+ "mariadb" {
+ set connector_name "mysql"
+ }
+ "sqlite3" -
+ "odbc" -
+ "postgres" -
+ "mysql" {
+ # OK
+ }
+ default {
+ return -code error -errorcode invalid_tdbc_driver "Invalid TDBC driver '$connector_name'"
+ }
}
set tdbc_connector "tdbc::${connector_name}"
@@ -63,7 +82,13 @@ namespace eval DIO {
public method open {} {
set connector_cmd "${tdbc_connector}::connection create ${tdbc_connector}#$connector_n"
if {$user != ""} { lappend connector_cmd -user $user }
- if {$db != ""} { lappend connector_cmd -db $db }
+ if {$db != ""} {
+ if {$connector_name == "sqlite3"} {
+ lappend connector_cmd $db
+ } else {
+ lappend connector_cmd -db $db
+ }
+ }
if {$pass != ""} { lappend connector_cmd -password $pass }
if {$port != ""} { lappend connector_cmd -port $port }
if {$host != ""} { lappend connector_cmd -host $host }
@@ -71,7 +96,6 @@ namespace eval DIO {
if {$clientargs != ""} { lappend connector_cmd {*}$clientargs }
#puts "evaluating $connector_cmd"
-
set connector [eval $connector_cmd]
incr connector_n
}
diff --git a/rivet/packages/dio/pkgIndex.tcl b/rivet/packages/dio/pkgIndex.tcl
index e8c3095..3a7cb5b 100644
--- a/rivet/packages/dio/pkgIndex.tcl
+++ b/rivet/packages/dio/pkgIndex.tcl
@@ -20,4 +20,4 @@ package ifneeded dio_Postgresql 0.1 [list source [file join $dir dio_Postgresql0
package ifneeded dio_Postgresql 1.2 [list source [file join $dir dio_Postgresql.tcl]]
package ifneeded dio_Sqlite 0.1 [list source [file join $dir dio_Sqlite01.tcl]]
package ifneeded dio_Sqlite 1.2 [list source [file join $dir dio_Sqlite.tcl]]
-package ifneeded dio_Tdbc 1.2.1 [list source [file join $dir dio_Tdbc.tcl]]
+package ifneeded dio_Tdbc 1.2.2 [list source [file join $dir dio_Tdbc.tcl]]
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tcl.apache.org
For additional commands, e-mail: commits-help@tcl.apache.org
(tcl-rivet) 04/05: fix wrong class names in comment
Posted by mx...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
mxmanghi pushed a commit to branch 3.2
in repository https://gitbox.apache.org/repos/asf/tcl-rivet.git
commit 60c5c8d6dba65e4e198a8c13aba9e33bedf12199
Author: Massimo Manghi <mx...@apache.org>
AuthorDate: Mon Oct 6 11:10:21 2025 +0200
fix wrong class names in comment
---
rivet/packages/aida/aida.tcl | 10 +++----
rivet/packages/aida/formatters.tcl | 54 ++++++++++++++++++++++++++++++++++++++
rivet/packages/dio/formatters.tcl | 4 +--
3 files changed, 60 insertions(+), 8 deletions(-)
diff --git a/rivet/packages/aida/aida.tcl b/rivet/packages/aida/aida.tcl
index 4e0864b..8a80576 100644
--- a/rivet/packages/aida/aida.tcl
+++ b/rivet/packages/aida/aida.tcl
@@ -1,7 +1,7 @@
-# aida.tcl -- agnostic interface to TDBC
-
-# Copyright 2002-2004 The Apache Software Foundation
-
+# aida.tcl -- agnostic interface to database access
+#
+# Copyright 2024 The Apache Tcl Team
+#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
@@ -15,8 +15,6 @@
# limitations under the License.
package require Tcl 8.6
-package require Itcl
-
source [file join [file dirname [info script]] sql.tcl]
namespace eval ::aida {
diff --git a/rivet/packages/aida/formatters.tcl b/rivet/packages/aida/formatters.tcl
new file mode 100644
index 0000000..60a5000
--- /dev/null
+++ b/rivet/packages/aida/formatters.tcl
@@ -0,0 +1,54 @@
+# formatters.tcl -- agnostic interface to database access special
+# fields formatters
+#
+# Copyright 2025 The Apache Tcl Team
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+package require TclOO
+
+namespace eval ::aida::formatters {
+
+ ::oo::class create RootFormatter {
+
+ variable SpecialFields [dict create]
+
+ classmethod quote {a_string} {
+ regsub -all {'} $a_string {\'} a_string
+ return $a_string
+ }
+
+ method register {table_name field_name ftype} {
+ dict set special_fields $table_name $field_name $ftype
+ }
+
+ method build {table_name field_name val convert_to} {
+ if {[dict exists $special_fields $table_name $field_name]} {
+ set field_type [dict get $special_fields $table_name $field_name]
+
+ if {[catch {
+ set field_value [$this $field_type $field_name $val $convert_to]
+ } e einfo]} {
+ set field_value "'[quote $val]'"
+ }
+
+ return $field_value
+ } else {
+ return "'[quote $val]'"
+ }
+ }
+
+ } ; ## ::oo::class RootFormatter
+
+}
diff --git a/rivet/packages/dio/formatters.tcl b/rivet/packages/dio/formatters.tcl
index c2b17b5..2e6f605 100644
--- a/rivet/packages/dio/formatters.tcl
+++ b/rivet/packages/dio/formatters.tcl
@@ -21,7 +21,7 @@
namespace eval ::DIO::formatters {
- # ::itcl::class FieldFormatter
+ # ::itcl::class RootFormatter
#
# we devolve the role of special field formatter to this
# class. By design this is more sensible with respect to
@@ -60,7 +60,7 @@ namespace eval ::DIO::formatters {
}
}
- } ; ## ::itcl::class FieldFormatter
+ } ; ## ::itcl::class RootFormatter
::itcl::class Mysql {
inherit RootFormatter
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@tcl.apache.org
For additional commands, e-mail: commits-help@tcl.apache.org