StoreSybase Back End Mods Required by StoreBase Mods 10/17/04 Carl Mascott The StoreBase mods that are part of StoreSybase require two simple modifications to every Store back end SQL broker. These modifications are provided for Store for PostgreSQL as part of the StoreSybase distribution. To create modifications for another Store back end SQL broker see the information below. 1. *Broker class>>typeToStringMap Add two new types to the dictionary. The additions for Store for PostgreSQL are: at: #PrimaryKeyComposite put: 'integer not null'; "Composite primary key" at: #PrimaryKeyRef put: 'integer null'; "Reference to primary key" The rules are that both should be the same type as #PrimaryKey. #PrimaryKeyComposite should have the 'not null' attribute. #PrimaryKeyRef should have the 'null' attribute. For most DBMSs (but not for Sybase) #PrimaryKeyComposite will have the same definition as #PrimaryKey. 2. *Broker class>>toPrimaryKey: This is a new method which you must create. The method for Store for PostgreSQL is: toPrimaryKey: aNumber "Convert a number to PostgreSQL primary key type." ^aNumber asInteger The rule is that the method return its argument converted to the Smalltalk numeric type used to hold a primary key. For most DBMSs the conversion will be "asInteger". For Sybase it is "asFixedPoint: 0". That's it!