logo       

Re: Objects in Database: msg#00158

db.sqlite.general

Subject: Re: Objects in Database

What about using the btree functions directly? I can't find much
code examples, so I wrote the following test:
-----
#include "btree.h"

int main() {
Btree *btree; BtCursor *cursor; int res;
int data = 100; char buffer[256];

sqliteBtreeOpen( "test", 0, 2000, &btree );

sqliteBtreeBeginTrans( btree );
sqliteBtreeCursor( btree, 2, 1, &cursor );
sqliteBtreeInsert( cursor, "one", 3, "apple", 5 );
sqliteBtreeInsert( cursor, "two", 3, &data, 2 );
sqliteBtreeCommit( btree );
sqliteBtreeCloseCursor( cursor );

sqliteBtreeCursor( btree, 2, 1, &cursor );
sqliteBtreeMoveto( cursor, "two", 3, &res );
if( res == 0 ) {
int size;
sqliteBtreeDataSize( cursor, &size );
sqliteBtreeData( cursor, 0, size, buffer );
printf( "Found 'two': %d\n", *buffer );
} else {
puts( "Can't find 'one'" );
}

sqliteBtreeClose( btree );
}
-----

Can this be used in place of Berkley/DB in this way?

Mike

--- In sqlite-F5Bj5G+ccuY@xxxxxxxxxxxxxxxx, "richa_verma77"
<richa_verma77@xxxx> wrote:
> Hi All,
>
> I have just started evaluating SQLite. I have a little question.
Can
> I store objects in the database? As the documentation states,
SQLite
> is typeless, so I guess I should not have a problem apart from the
> 2GB limit ofcourse.
>
> Thanks


------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/CBxunD/vN2EAA/xGHJAA/EbFolB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
sqlite-unsubscribe-VgYJa0VH1e9BDgjK7y7TUQ@xxxxxxxxxxxxxxxx



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/





<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise