Tag: Databases
SQLite 3.6.13 wrapper available
by admin on Apr.20, 2009, under Smalltalk
I created a new version of this wrapper library. This version now runs against the official dynamic link library 3.6.13 from the author of SQLite.
Available from: VASTGoodies
PostgreSQL(0.0.39) - new features
by admin on Apr.20, 2009, under Smalltalk
Several new API calls have been wrapped and lots of bugs have been fixed.
New API calls - Encoding
Some API calls have been wrapped to get/set information about the current connection client encoding style.
MSKPSQLInterface>>currentClientEncodingString: anID
This method returns a string (e.h. “UTF8″) describing the internal PostgreSQL encoding id “anID”. Its a helper method, which is used by the class PGConn.
PGConn>>currentClientEncodingID
This method returns the internal encoding id for the current connection
PGConn>>currentClientEncodingString
This method returns a textual representation of the internal encoding id for the current connection
New API calls - Escaping
Some API calls have been wrapped to help creating correct string for sql command.
PGConn>>escapeString: aString
This method returns a correct escaped string
PGConn>>escapeByteArray: aByteArray
This method returns a correct escaped byte array
New API calls - Asynchronous command execution
Some API calls have been wrapped execute multiple SQL-commands with ONE server call.
PGConn>>sendQuery: cmdString
This method sends a SQL command to the server. The SQL command may consist out of several commands
PGConn>>consumesInput
Helper method to manage incoming data from the server
PGConn>>isBusy
Helper method to check, if the server is still executing some commands
And here an example how to use it …
| aPGResult sqlCommandString resultCounter result abort|
sqlCommandString := 'INSERT into weather (city, prcp) values(''Hamburg'',12.6);INSERT into weather (city, prcp) values(''Berlin'',13.2);INSERT into weather (city, prcp) values(''Bremen'',32.1)'.
dbConnection sendQuery: sqlCommandString.
resultCounter := 0.
abort := false.
[ abort ] whileFalse:[
dbConnection consumesInput.
dbConnection isBusy
ifTrue:[ (Delay forMilliseconds: 100) wait ]
ifFalse:[
result := dbConnection getResult.
result isNil
ifTrue:[ abort := true ]
ifFalse:[
resultCounter := resultCounter + 1.
result clear
]
].
].
self assert: (resultCounter = 3).
PostgreSQL(0.0.39) - new structure
by admin on Apr.20, 2009, under Smalltalk
I changed the structure of the MSKPostgreSQL project. I created an additional application (and configuration map) named “MSKPostgreSQLAbtDBMLayer”, where all source code is located to make the wrapper compatible with the VASmalltalk database layer.
SQLite 3.6.12 wrapper available
by admin on Apr.02, 2009, under Smalltalk
I created a new version of this wrapper library. This version now runs against the official dynamic link library from the author of SQLite. I do not build an alternative library from the sources any more and hope, that the different calling conventions do not matter.
The source code is available from:
PostgreSQL Wrapper
by admin on Mar.24, 2009, under Smalltalk
Adding all this support for the native binary result format is pretty hard. The reason is pretty simple: it is not documented. One has to query the conversion methods for each datatype from a running PostgreSQl database, then lookup the method within the PostgreSQL source code and interpet the code.
Therefore the next version will be published, when most of these datatypes have been done. Up to now int2, int4 and int8 has been done, box, boolean, strings. I now working on numerical and decimal, which is reverse engineering. Then date, time and timestamps are coming and then - at last - most of the other “special” datatypes.