[Pkg] Packages: Packages-Common-kph.16.mcz

squeaksource-noreply at iam.unibe.ch squeaksource-noreply at iam.unibe.ch
Sat Jun 7 03:22:22 UTC 2008


A new version of Packages-Common was added to project Packages:
http://www.squeaksource.com/Packages/Packages-Common-kph.16.mcz

==================== Summary ====================

Name: Packages-Common-kph.16
Author: kph
Time: 7 June 2008, 4:22:14 am
UUID: 2d94ca06-14d9-4381-96c2-ba808f86a105
Ancestors: Packages-Common-kph.15

added SQLLite3 from SqueakMap

=============== Diff against Packages-Common-kph.15 ===============

Item was added:
+ ----- Method: PackagesAllVersions>>SQLite3 (in category 'Persistence') -----
+ SQLite3
+ 
+ 	self name: 'SQLite3'.
+ 	self version: '0.1.0'.
+ 
+ 	info summary: 'A simple FFI wrapper for SQLite3 based on Avi Bryant''s SQLite (v.2) wrapper'.
+ 	info author: 'Fred Mannby /cf ate mannby dote come/'.
+ 	info owner: 'Claes-Fredrik Mannby'.
+ 	info created: '24 November 2005 4:06:38 pm'.
+ 	info updated: '24 November 2005 4:06:38 pm'.
+ 	info description: 
+ 
+ 'This is a first cut at an FFI wrapper for SQLite3 based on Avi Bryant''s wrapper for SQLite version 2.
+ 
+ It requires the FFI plugin (SqueakFFIPrims), and SQLite3 (it comes with Tiger, but you can also get it and documentation from http://www.hwaci.com/sw/sqlite).
+ 
+ The wrapper has only been tested with Squeak 3.8 and Mac OS X Tiger (10.4.2). If there is a desire for it, I may try to make it work smoothly on other platforms. In order to load the library on Mac OS X, you should execute the following EXACT commands in the Terminal:
+ 
+ sudo mkdir /System/Library/Frameworks/libsqlite3.framework
+ sudo ln -s /usr/local/lib/libsqlite3.dylib /System/Library/Frameworks/libsqlite3.framework/libsqlite3
+ 
+ The wrapper is simply a modification of Avi''s code, so they will not work side by side.
+ 
+ It passes Avi''s test code for me:
+ 
+ | con s1 s2 s3 arrayOfDicts |
+     con := SQLiteConnection fileNamed: ''test.db''.
+     con inspect.
+     s1 := ''create table employee (id, name)''.
+     s2 := ''insert into employee values (1, ''''Adam'''')''.
+     s3 := ''insert into employee values (2, ''''Eve'''')''.
+     (Array
+         with: s1
+         with: s2
+         with: s3)
+         do: [:sql | con execute executeQuery: sql].
+     arrayOfDicts := con executeQuery: ''SELECT * FROM employee''.
+     arrayOfDicts inspect.
+     con close.
+ 
+ Note that if you are having trouble getting FFI to find the library and functions, you may need to inspect SqliteLibrary, and set the default class variable default to nil and try again.'.
+ 
+ 	 
+ 	self load: [
+ 		Installer wsm install: 'SQLite3'.
+ 	].
+ 
+ 	self unload: [
+ 		Installer mc unload: 'SQLite3'.
+ 	].!



More information about the Packages mailing list