]> gitweb.factorcode.org Git - factor.git/commitdiff
db2: not sure where to go from here db5
authorDoug Coleman <doug.coleman@gmail.com>
Wed, 19 Jan 2022 03:38:03 +0000 (21:38 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Wed, 19 Jan 2022 03:38:03 +0000 (21:38 -0600)
basis/db2/types/types.factor
basis/postgresql/db2/errors/errors.factor
basis/postgresql/db2/ffi/ffi.factor
basis/postgresql/db2/result-sets/result-sets.factor
basis/postgresql/db2/statements/statements.factor
basis/reconstructors/reconstructors.factor

index 2d04341de7eae6ea690b41b4b7ac32b5b9199303..d65930d71c593ac4d58773b78b5a3e9d95782738 100644 (file)
@@ -63,7 +63,7 @@ SQL-TYPES:
     TEXT CHARACTER VARCHAR DATE
     TIME DATETIME TIMESTAMP
     BLOB FACTOR-BLOB
-    URL ;
+    URL JSON ;
 
 ! Delete +not-null+
 SQL-MODIFIERS: SERIAL AUTOINCREMENT UNIQUE DEFAULT NOT-NULL NULL
index d03bcd0d9dd07ac882a9b4c419cb4a1155ea58f6..f428cd9d8d3d4d96053c4fe5fd6a06ec236df714 100644 (file)
@@ -42,10 +42,10 @@ Line = "LINE " [0-9]+:line ": " .+:sql
 
 ]=]
 
-:: set-caret-position ( error caret-line -- error )
-    caret-line length
-    error line>> number>string length "LINE : " length +
-    - [ error ] dip >>column ;
+:: set-caret-position ( $error $caret-line -- error )
+    $caret-line length
+    $error line>> number>string length "LINE : " length +
+    - [ $error ] dip >>column ;
 
 : postgresql-location ( line column -- obj )
     [ parse-postgresql-line-error ] dip
index 113e2271dfa77150aed3946af40d1ff10ec16598..5e793f875439cba9aeb56b7b25867af21c3d7152 100644 (file)
@@ -21,6 +21,9 @@ CONSTANT: CONNECTION_AUTH_OK                5
 CONSTANT: CONNECTION_SETENV                 6
 CONSTANT: CONNECTION_SSL_STARTUP            7
 CONSTANT: CONNECTION_NEEDED                 8
+CONSTANT: CONNECTION_CHECK_WRITABLE         9
+CONSTANT: CONNECTION_CONSUME               10
+CONSTANT: CONNECTION_GSS_STARTUP           11
 
 ! PostgresPollingStatusType
 CONSTANT: PGRES_POLLING_FAILED              0
@@ -38,6 +41,8 @@ CONSTANT: PGRES_COPY_IN                     4
 CONSTANT: PGRES_BAD_RESPONSE                5
 CONSTANT: PGRES_NONFATAL_ERROR              6
 CONSTANT: PGRES_FATAL_ERROR                 7
+CONSTANT: PGRES_COPY_BOTH                   8
+CONSTANT: PGRES_SINGLE_TUPLE                9
 
 ! PGTransactionStatusType;
 CONSTANT: PQTRANS_IDLE                      0
@@ -50,6 +55,18 @@ CONSTANT: PQTRANS_UNKNOWN                   4
 CONSTANT: PQERRORS_TERSE                    0
 CONSTANT: PQERRORS_DEFAULT                  1
 CONSTANT: PQERRORS_VERBOSE                  2
+CONSTANT: PQERRORS_SQLSTATE                 3
+
+! PGContextVisibility
+CONSTANT: PQSHOW_CONTEXT_NEVER              0
+CONSTANT: PQSHOW_CONTEXT_ERRORS             1
+CONSTANT: PQSHOW_CONTEXT_ALWAYS             2
+
+! PGPing
+CONSTANT: PGPING_OK                         0
+CONSTANT: PGPING_REJECT                     1
+CONSTANT: PQPING_NO_RESPONSE                2
+CONSTANT: PQPING_NO_ATTEMPT                 3
 
 CONSTANT: InvalidOid 0
 
index 8e99f4dcb96d45da4596fcf1a6fb6d4dff3f6f31..ca58844b2c015d54bab0c1dcabcafd89f493ac0c 100644 (file)
@@ -3,10 +3,10 @@
 USING: accessors alien.c-types alien.data arrays calendar.format
 calendar.parser combinators db2.binders db2.connections
 db2.errors db2.result-sets db2.types db2.utils destructors
-io.encodings.utf8 kernel libc math namespaces orm.binders
-postgresql.db2.connections.private postgresql.db2.ffi
-postgresql.db2.lib present sequences serialize
-specialized-arrays strings urls ;
+io.encodings.utf8 json.reader kernel libc math namespaces
+orm.binders postgresql.db2.connections.private
+postgresql.db2.ffi postgresql.db2.lib present sequences
+serialize specialized-arrays strings urls ;
 IN: postgresql.db2.result-sets
 SPECIALIZED-ARRAY: uint
 SPECIALIZED-ARRAY: void*
@@ -127,6 +127,7 @@ M: postgresql-result-set column
         { BLOB [ pq-get-blob ] }
         { BOOLEAN [ pq-get-boolean ] }
         { URL [ pq-get-string dup [ >url ] when ] }
+        { JSON [ pq-get-string dup [ json> ] when ] }
         { FACTOR-BLOB [
             pq-get-blob
             dup [ bytes>object ] when ] }
index 15969a75853def641222da402818b1c486e97110..f7b9b315ba0e0e5ff813fc814baf86ab391f0ce3 100644 (file)
@@ -1,9 +1,8 @@
 ! Copyright (C) 2009 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors db2.connections
-postgresql.db2.connections.private postgresql.db2.ffi
-postgresql.db2.lib db2.statements destructors kernel namespaces
-sequences math.parser ;
+USING: accessors db2.connections db2.statements kernel
+math.parser namespaces postgresql.db2.connections.private
+postgresql.db2.ffi postgresql.db2.lib sequences ;
 IN: postgresql.db2.statements
 
 M: postgresql-db-connection prepare-statement*
index 84e0f37ce1645a175968570141e066aca3215fe2..93e3027dccf3542d68993c46efa40937aaa7389e 100644 (file)
@@ -1,10 +1,9 @@
 ! Copyright (C) 2010 Doug Coleman.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors assocs fry grouping hashtables kernel make
-math multiline sequences splitting.monotonic ;
+USING: accessors assocs grouping hashtables kernel make math
+multiline sequences splitting.monotonic ;
 IN: reconstructors
 
-
 TUPLE: reconstructor row-spec combiner-spec ;
 
 
@@ -165,10 +164,6 @@ TUPLE: nested-reconstructor
     }
 }
 
-
-
-
-
 */
 
 ERROR: not-found key ;