FROM : Joe Schiwall
DATE : Sun Jan 13 22:10:20 2002
on 1/7/02 10:17 PM, Kent Glenn at <email_removed> wrote:
> I'm building an application that needs a single user/local database. I
> really don't want to have the user install MySQL, since I think it's an
> overkill for what I need.
>
> I will basically need to hold customer records, with a few other small
> tables. There will be some relationships. I'm guessing that on the avg.,
> there will be around 5000 customer records.
Like everybody else I would love to see EOF for Obj-C/Cocoa. Just having
the flat file database adapter would be a big help, but I am not expecting
anything soon.
In the meantime, I came across an open source, LGPL licensed database engine
you may want to look at. I haven't tried it myself yet but the web site is:
<http://linux.techass.com/projects/xdb/>
I looked at the sample code and it looks like it might be nice for what you
are trying to do, for example, to create a table:
xbSchema MyRecord[] =
{
{ "FIRSTNAME", XB_CHAR_FLD, 15, 0 },
{ "LASTNAME", XB_CHAR_FLD, 20, 0 },
{ "BIRTHDATE", XB_DATE_FLD, 8, 0 },
{ "AMOUNT", XB_NUMERIC_FLD, 9, 2 },
{ "SWITCH", XB_LOGICAL_FLD, 1, 0 },
{ "FLOAT1", XB_FLOAT_FLD, 9, 2 },
{ "FLOAT2", XB_FLOAT_FLD, 9, 1 },
{ "FLOAT3", XB_FLOAT_FLD, 9, 2 },
{ "FLOAT4", XB_FLOAT_FLD, 9, 3 },
{ "MEMO1", XB_MEMO_FLD, 10, 0 },
{ "ZIPCODE", XB_NUMERIC_FLD, 5, 0 },
{ "",0,0,0 }
};
and to access the records:
cout << "\nLoop through backwards.." << endl;
rc = MyFile.GetLastRecord();
while( rc == XB_NO_ERROR )
{
// MyFile.GetField( lname, buf );
cout << "Last Name = " << MyFile.GetStringField( lname ) << endl;
cout << "Logical Field = " << MyFile.GetLogicalField( "SWITCH" ) <<
endl;
rc = MyFile.GetPrevRecord();
}
If the engine is decent, maybe we can put an Obj-C wrapper on it so the
cocoa community would at least have some kind of DB solution for now.
Hope that helps,
Joe Schiwall
MacTelligence
DATE : Sun Jan 13 22:10:20 2002
on 1/7/02 10:17 PM, Kent Glenn at <email_removed> wrote:
> I'm building an application that needs a single user/local database. I
> really don't want to have the user install MySQL, since I think it's an
> overkill for what I need.
>
> I will basically need to hold customer records, with a few other small
> tables. There will be some relationships. I'm guessing that on the avg.,
> there will be around 5000 customer records.
Like everybody else I would love to see EOF for Obj-C/Cocoa. Just having
the flat file database adapter would be a big help, but I am not expecting
anything soon.
In the meantime, I came across an open source, LGPL licensed database engine
you may want to look at. I haven't tried it myself yet but the web site is:
<http://linux.techass.com/projects/xdb/>
I looked at the sample code and it looks like it might be nice for what you
are trying to do, for example, to create a table:
xbSchema MyRecord[] =
{
{ "FIRSTNAME", XB_CHAR_FLD, 15, 0 },
{ "LASTNAME", XB_CHAR_FLD, 20, 0 },
{ "BIRTHDATE", XB_DATE_FLD, 8, 0 },
{ "AMOUNT", XB_NUMERIC_FLD, 9, 2 },
{ "SWITCH", XB_LOGICAL_FLD, 1, 0 },
{ "FLOAT1", XB_FLOAT_FLD, 9, 2 },
{ "FLOAT2", XB_FLOAT_FLD, 9, 1 },
{ "FLOAT3", XB_FLOAT_FLD, 9, 2 },
{ "FLOAT4", XB_FLOAT_FLD, 9, 3 },
{ "MEMO1", XB_MEMO_FLD, 10, 0 },
{ "ZIPCODE", XB_NUMERIC_FLD, 5, 0 },
{ "",0,0,0 }
};
and to access the records:
cout << "\nLoop through backwards.." << endl;
rc = MyFile.GetLastRecord();
while( rc == XB_NO_ERROR )
{
// MyFile.GetField( lname, buf );
cout << "Last Name = " << MyFile.GetStringField( lname ) << endl;
cout << "Logical Field = " << MyFile.GetLogicalField( "SWITCH" ) <<
endl;
rc = MyFile.GetPrevRecord();
}
If the engine is decent, maybe we can put an Obj-C wrapper on it so the
cocoa community would at least have some kind of DB solution for now.
Hope that helps,
Joe Schiwall
MacTelligence
| Related mails | Author | Date |
|---|---|---|
| Kent Glenn | Jan 8, 04:17 | |
| Troy Brumley | Jan 8, 04:28 | |
| Michael D'Haem | Jan 8, 04:42 | |
| Jim Puls | Jan 8, 04:52 | |
| Finlay Dobbie | Jan 8, 20:23 | |
| Thomas Hudson | Jan 8, 20:43 | |
| Andreas Monitzer | Jan 8, 20:55 | |
| heckj | Jan 8, 22:20 | |
| michel RENON | Jan 9, 16:32 | |
| Todd Blanchard | Jan 10, 02:12 | |
| Jeff Galyan | Jan 10, 02:59 | |
| Kent Glenn | Jan 10, 03:00 | |
| Chris Hanson | Jan 10, 07:28 | |
| Jeff LaMarche | Jan 10, 08:57 | |
| Kaelin Colclasure | Jan 10, 18:53 | |
| Dan Waylonis | Jan 11, 05:19 | |
| Todd Blanchard | Jan 11, 19:13 | |
| Joe Schiwall | Jan 13, 22:10 | |
| Simon Stapleton | Jan 14, 12:48 | |
| Joe Schiwall | Jan 14, 17:24 | |
| Kaelin Colclasure | Jan 14, 18:37 | |
| Andreas Monitzer | Jan 14, 20:32 | |
| Chris Hanson | Jan 15, 03:10 |






Cocoa mail archive

