On 12/3/2010 7:52 PM, Frank Church wrote:
I am looking for a SqueakDBX demo that shows how to display the output
of records from the database, like outputting them in a tabular format.
Does anyone know of an example somewhere?
Hello,
I apologize, I didn't even see this message until I saw Mariano's reply.
I use SqueakDBX directly without Glorp connecting to a PostgreSQL
database with about 50 million rows currently. I am storing minutes of
financial data. Since my data is by its nature very tabular I saw no
need for using an ORM.
My use is very simple but maybe it will help.
I currently only use SqueakDBX for retrieving this data. The data is
inserted via a different program.
Here is the method I use to get my data and insert it into a Matrix.
loadOHLC
"Loads the Open High Low Close (bid/ask) and hlavg, hlcavg columns
from the database.
Creates a OneWeekData (Matrix) object for the data."
| con rows |
con := self otogConnection.
rows := (con execute: 'select startdate, bidopen, bidhigh, bidlow,
bidclose, askopen, askhigh, asklow, askclose from ', self instrument, '
where (', self week asDbxString, ' < startdate) AND (startdate < ', self
weekEnd asDbxString , ')') rows.
ohlc := OneWeekData rows: (rows size) columns: 10.
1 to: rows size do: [:row || newRow |
newRow := ((rows at: row) values). newRow := newRow copyWith:
(((newRow at: 3) + (newRow at: 4) + (newRow at: 5)) / 3).
ohlc atRow: row put: newRow ].
Maybe this real world example will help. As I said my usage is simple.
SqueakDBX has worked very well for me.
I simply wrote the sql statement I wanted executed with my columns
ordered as I wanted for the rows retrieved. If I remember correctly each
rows values are when passed the "values" message return an Array which
is what I pass to my Matrix.
If we aren't providing the answers desired. Please provide more
information to direct us. Mariano has been very helpful for any of my
questions.
Jimmie