diff options
author | Norbert Preining <norbert@preining.info> | 2022-04-04 03:14:42 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-04-04 03:14:42 +0000 |
commit | 7548e4d37c2aaefd32fe0a9bcd83f8e71326dde1 (patch) | |
tree | d335b608e63e9b3c37d7ba0e567c63e77250e171 /systems/texlive/tlnet/tlpkg/tltcl/lib/tdbcpostgres1.1.3 | |
parent | 506de1e2d3515161cdbc7018b4ccc9e49d7f86e8 (diff) |
CTAN sync 202204040314
Diffstat (limited to 'systems/texlive/tlnet/tlpkg/tltcl/lib/tdbcpostgres1.1.3')
-rw-r--r-- | systems/texlive/tlnet/tlpkg/tltcl/lib/tdbcpostgres1.1.3/pkgIndex.tcl | 14 | ||||
-rw-r--r-- | systems/texlive/tlnet/tlpkg/tltcl/lib/tdbcpostgres1.1.3/tdbcpostgres.tcl | 135 | ||||
-rwxr-xr-x | systems/texlive/tlnet/tlpkg/tltcl/lib/tdbcpostgres1.1.3/tdbcpostgres113.dll | bin | 0 -> 103950 bytes |
3 files changed, 149 insertions, 0 deletions
diff --git a/systems/texlive/tlnet/tlpkg/tltcl/lib/tdbcpostgres1.1.3/pkgIndex.tcl b/systems/texlive/tlnet/tlpkg/tltcl/lib/tdbcpostgres1.1.3/pkgIndex.tcl new file mode 100644 index 0000000000..fe16e4a896 --- /dev/null +++ b/systems/texlive/tlnet/tlpkg/tltcl/lib/tdbcpostgres1.1.3/pkgIndex.tcl @@ -0,0 +1,14 @@ +# Index file to load the TDBC Postgres package. + +if {![package vsatisfies [package provide Tcl] 8.6-]} { + return +} +if {[package vsatisfies [package provide Tcl] 9.0-]} { + package ifneeded tdbc::postgres 1.1.3 \ + "[list source [file join $dir tdbcpostgres.tcl]]\;\ + [list load [file join $dir tcl9tdbcpostgres113.dll] [string totitle tdbcpostgres]]" +} else { + package ifneeded tdbc::postgres 1.1.3 \ + "[list source [file join $dir tdbcpostgres.tcl]]\;\ + [list load [file join $dir tdbcpostgres113.dll] [string totitle tdbcpostgres]]" +} diff --git a/systems/texlive/tlnet/tlpkg/tltcl/lib/tdbcpostgres1.1.3/tdbcpostgres.tcl b/systems/texlive/tlnet/tlpkg/tltcl/lib/tdbcpostgres1.1.3/tdbcpostgres.tcl new file mode 100644 index 0000000000..c5c4ef0f85 --- /dev/null +++ b/systems/texlive/tlnet/tlpkg/tltcl/lib/tdbcpostgres1.1.3/tdbcpostgres.tcl @@ -0,0 +1,135 @@ +# tdbcpostgres.tcl -- +# +# Class definitions and Tcl-level methods for the tdbc::postgres bridge. +# +# Copyright (c) 2009 by Slawomir Cygan +# +# See the file "license.terms" for information on usage and redistribution +# of this file, and for a DISCLAIMER OF ALL WARRANTIES. +# +#------------------------------------------------------------------------------ + +package require tdbc + +::namespace eval ::tdbc::mypostgres { + + namespace export connection datasources drivers + +} + +#------------------------------------------------------------------------------ +# +# tdbc::postgres::connection -- +# +# Class representing a connection to a Postgres database. +# +#------------------------------------------------------------------------------- + +::oo::class create ::tdbc::postgres::connection { + + superclass ::tdbc::connection + + # The constructor is written in C. It takes alternating keywords + # and values pairs as its arguments. (See the manual page for the + # available options.) + + # The 'statementCreate' method delegates to the constructor of the + # statement class + + forward statementCreate ::tdbc::postgres::statement create + + + # The 'prepareCall' method gives a portable interface to prepare + # calls to stored procedures. It delegates to 'prepare' to do the + # actual work. + + method preparecall {call} { + regexp {^[[:space:]]*(?:([A-Za-z_][A-Za-z_0-9]*)[[:space:]]*=)?(.*)} \ + $call -> varName rest + if {$varName eq {}} { + my prepare \\{$rest\\} + } else { + my prepare \\{:$varName=$rest\\} + } + } + + # The 'init', 'begintransaction', 'commit, 'rollback', 'tables' + # and 'columns' methods are implemented in C. + +} + +#------------------------------------------------------------------------------ +# +# tdbc::postgres::statement -- +# +# The class 'tdbc::postgres::statement' models one statement against a +# database accessed through a Postgres connection +# +#------------------------------------------------------------------------------ + +::oo::class create ::tdbc::postgres::statement { + + superclass ::tdbc::statement + + # The 'resultSetCreate' method forwards to the constructor of the + # result set. + + forward resultSetCreate ::tdbc::postgres::resultset create + + # Methods implemented in C: + # + # constructor connection SQLCode + # The constructor accepts the handle to the connection and the SQL code + # for the statement to prepare. It creates a subordinate namespace to + # hold the statement's active result sets, and then delegates to the + # 'init' method, written in C, to do the actual work of preparing the + # statement. + # params + # Returns descriptions of the parameters of a statement. + # paramtype paramname ?direction? type ?precision ?scale?? + # Declares the type of a parameter in the statement + +} + +#------------------------------------------------------------------------------ +# +# tdbc::postgres::resultset -- +# +# The class 'tdbc::postgres::resultset' models the result set that is +# produced by executing a statement against a Postgres database. +# +#------------------------------------------------------------------------------ + +::oo::class create ::tdbc::postgres::resultset { + + superclass ::tdbc::resultset + + # The 'nextresults' method is stubbed out; tdbcpostgres does not + # allow a single call to return multiple results. + + method nextresults {} { + while {[my nextdict rubbish]} {} + return 0 + } + + # Methods implemented in C include: + + # constructor statement ?dictionary? + # -- Executes the statement against the database, optionally providing + # a dictionary of substituted parameters (default is to get params + # from variables in the caller's scope). + # columns + # -- Returns a list of the names of the columns in the result. + # nextdict + # -- Stores the next row of the result set in the given variable in + # the caller's scope as a dictionary whose keys are + # column names and whose values are column values, or else + # as a list of cells. + # nextlist + # -- Stores the next row of the result set in the given variable in + # the caller's scope as a list of cells. + # rowcount + # -- Returns a count of rows affected by the statement, or -1 + # if the count of rows has not been determined. + +} diff --git a/systems/texlive/tlnet/tlpkg/tltcl/lib/tdbcpostgres1.1.3/tdbcpostgres113.dll b/systems/texlive/tlnet/tlpkg/tltcl/lib/tdbcpostgres1.1.3/tdbcpostgres113.dll Binary files differnew file mode 100755 index 0000000000..8ab4649c1e --- /dev/null +++ b/systems/texlive/tlnet/tlpkg/tltcl/lib/tdbcpostgres1.1.3/tdbcpostgres113.dll |