Next: Builtin Converters, Up: Octet Molding/Mashing [Contents][Index]
To see if a type is “known” to Guile-PG, use the type-registered?
procedure. Use type-foo
procs for particulars.
Return #t
if type (a symbol) has registered converters.
Return the stringifier for type (a symbol).
Return the objectifier for type (a symbol).
Return the default for type (a symbol).
Return the SQL name (a string) of type (a symbol).
Here is a simple example that uses type-objectifier
to convert
a two-dimensional text
array value into a nested list:
(let ((raw (pg-getvalue result 0 0)) (conv (type-objectifier '**text))) (format #t "~A~%~S~%" raw (conv raw))) -| {{a,b},{c,d}} -| (("a" "b") ("c" "d"))
Note that even though the type is an “array”, as implied by the leading asterisks, the result is a list. This is mostly due to a limitation in PostgreSQL: dimensionality is not stored for array types, so the conversion cannot be done in a random-access manner. Perhaps this will change in the future.
NB: The rest of this section describes an obsolete interface.
To get a converter object that encapsulates
the stringifier, the objectifier and the default, use
the procedure
dbcoltype-lookup
. The components of the returned object can be read
using the dbcoltype:FOO
procedures.
NB: This procedure will be removed by 2015-12-31.
Return names of all registered converters.
NB: This procedure will be removed by 2015-12-31.
Return a converter object given its type-name, a symbol.
Return #f
if no such object by that name exists.
NB: This procedure will be removed by 2015-12-31.
Extract stringifier from the converter object tc.
NB: This procedure will be removed by 2015-12-31.
Extract objectifier from the converter object tc.
NB: This procedure will be removed by 2015-12-31.
Extract default string from the converter object tc.
Next: Builtin Converters, Up: Octet Molding/Mashing [Contents][Index]