[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

3.46 diff

Procedure for diff.

Function: lcs-edit-list list1 list2 [equiv?]

returns a list of difference of list1 and list2 as following format.

((+ row-number object-to-be-added)    ; case of addition
 (- row-number object-to-be-removed)  ; case of change
 (+ row-number object-to-be-added)
 (- row-number object-to-be-removed)  ; case of removal
 ...)
Function: make-patch list1 list2 [equiv?]

returns a patch object of difference of list1 and list2.

Function: apply-patch patch list

applies the patch object to the given list.



Accessing databases

Procedures for accessing databases. DB types can be convert to corresponding Scheme types using DB metadata shown as follows.

RDB typeScheme type
BOOLEAN#t or #f
CHARstring
DATESRFI-19 date
DECIMALexact number(rational number)
DOUBLEinexact number
FLOATinexact number
INTEGERexact integer
NUMERICexact number(rational number)
REALinexact number
SMALLINTexact integer
TIMESTAMPSRFI-19 date
TINYINTexact integer
VARCHARstring

These procedures use prepared SQL for preventing SQL injection attack.

Scheme types can also be convert to corresponding DB shown as follows.

Scheme typeRDB type
stringstring(String)
small integersmall integer(int)
long integerlong integer(BigInteger)
SRFI-19 datedate (java.sql.Timestampまたはjava.sql.Date)
inexact numberfloat number(double or float)
#t or #fboolean

The result of queries containes in result-bag.
It is the same way to treating list that you get data from the result bag.

Function: jdbc-use-db dbms-name

declares the DBMS. dbms-name is a symbol shown as follows.

dbms-nameRDBMS
oracleOracle
mysqlMySQL
postgresqlPostgreSQL
sqliteSQLite
Function: jdbc-connect uri

connects the RDBMS with the connecting URI.

Function: jdbc-prepare connection SQL

compiles the SQL in the connection and prepares a statement using JDBC.

Function: jdbc-query statement param …

queries the prepared statement. Parameters is specified by param ….

Function: jdbc-update! statement param …

executes the updating SQL or DDL. Parameters is specified by param ….

Function: jdbc-open? closable-object

returns #t is the object is open. closable-object is a JDBC connection, a JDBC statement and a JDBC result bag.

Function: jdbc-close closable-object

closes the closable object mentioned above.

Function: get-result-bag-row result-bag

gets a row object from the result bag. This procedure corresponds to procedure car in usual list processing.

Function: get-result-bag-row-list result-bag

gets a list of a row from the result bag. This procedure corresponds to procedure car in usual list processing.

Function: end-result-bag? result-bag

returns #t if the result bag is terminated. This procedure corresponds to procedure null? in usual list processing.

Function: next-result-bag result-bag

proceeds the cursor of the result bag. This procedure corresponds to procedure cdr in usual list processing.

Function: row-ref row-of-result-bag symbol-of-row-id

gets an object from the row object of result bag.


[ << ] [ < ] [ Up ] [ > ] [ >> ]

This document was generated on August 9, 2012 using texi2html 5.0.