Re: [sqlite] Reg: In Memory Database Using SQLite

2010-07-10 Thread Subhadeep Ghosh
Hi Chris,

I had attached the source code but it mysteriously vanished. I'm guessing
that this mailing list does not support mail attachments. However, if you
want I could mail it to you on your personal mail ID.

Thank you and regards,
Subhadeep.

On Sat, Jul 10, 2010 at 8:09 PM, <c...@comcast.net> wrote:

>
>
> Hi Subhadeep,
>
> I'm not seeing the source code included anywhere in your email.
>
>
>
> Thx
>
> -Chris
>
>
> - Original Message -
> From: "Subhadeep Ghosh" <subhadeep.gh...@uniken.com>
> To: sqlite-users@sqlite.org
> Sent: Wednesday, July 7, 2010 1:51:28 PM
> Subject: [sqlite] Reg: In Memory Database Using SQLite
>
> Hello People,
>
> I finally managed to create a wrapper around the SQLite core to support the
> creation of in-memory databases. The wrapper comprises of three functions -
> one to serialize the database, one to de-serialize a database and the third
> one to do the cleanup job.
>
> The function which serializes a database, copies the entire contents of the
> database to a block of memory. The function which de-serializes takes a
> block of memory as input and creates a database object out of it.
>
> I am including the source code for the interested souls and I've not put
> comments as I hate doing it.
>
> I hope you guys find the code useful or at-least interesting.
>
> Thank you and regards,
> Subhadeep Ghosh.
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Reg: In Memory Database Using SQLite

2010-07-08 Thread Subhadeep Ghosh
Hello Eric,

I am aware of the functionality which you mentioned. But the reason why I
ended up coding the feature was because of a very specific requirement. My
requirement was such that some of my client applications were running on
disk-less systems where I was not using any kind of network storage. But my
applications used SQLite. So I coded the below mentioned feature such that
the database was being stored on the server and when the disk-less clients
wanted to use them, they fetched the database from the server over the
network and directly create a database out of the fetched data (basically
serializing and de-serializing the database).

I am guessing that SQLite does not support such functionality. The closest
thing would have been to fetch the database over the network, store it in a
file (which in this case is not possible) and then open the database.

I maybe wrong, but if such a feature already exists then I would be more
than happy to adopt it in my code.

Thank you and regards,
Subhadeep Ghosh.

On Thu, Jul 8, 2010 at 6:40 PM, Eric Smith <eas@gmail.com> wrote:

> Subhadeep Ghosh wrote:
>
> > I finally managed to create a wrapper around the SQLite core to support
> > the creation of in-memory databases.  The wrapper comprises of three
> > functions - one to serialize the database, one to de-serialize a database
> > and the third one to do the cleanup job.
> >
> > The function which serializes a database, copies the entire contents of
> > the database to a block of memory.  The function which de-serializes
> takes
> > a block of memory as input and creates a database object out of it.
> >
> > I am including the source code for the interested souls and I've not put
> > comments as I hate doing it.
> >
> > I hope you guys find the code useful or at-least interesting.
>
> I hope you didn't spend too much time on that.  SQLite supports
> in-memory databases natively: if you open the file called ":memory:" you
> get an in-memory database that dies when the connection is closed:
>
> http://sqlite.org/c3ref/open.html
>
> --
> Eric A. Smith
>
> More people would come here if it weren't so crowded.
>-- Yogi Berra
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] EXTERNAL:Re: EXTERNAL: setup sqlite in vc++

2010-07-07 Thread Subhadeep Ghosh
Hello Seak,

Try doing the following,

1. In your project select and right click on the sqlite3.c file.
2. Then click on the 'Properties' on the drop down menu.
3. When the 'sqlite3.c Property Pages' dialog opens up, click on the 'C/C++'
tree node.
4. Next click on the 'Advanced' item in the 'C/C++' tree node.
5. In the right pane of the dialog locate the 'Compile As' item. I suspect
that it is set to 'Compile as C++ code (/TP)'. If that is the case then you
could click on it and another drop down should appear from which you should
select the 'Compile as C Code (/TC)' option.

That should take care of your compiler errors.

Thank you and regards,
Subhadeep Ghosh.

On Thu, Jul 8, 2010 at 4:24 AM, smengl90 <
fixed-term.seak.meng...@us.bosch.com> wrote:

>
> Still doesn't work. Do I need the precompiled binaries at all? or including
> sqlite3.c and sqlite3.h found in the amalgamation is enough?
>
>
>
> SimonDavies wrote:
> >
> > On 7 July 2010 18:19, smengl90 <fixed-term.seak.meng...@us.bosch.com>
> > wrote:
> >>
> >> Ok, I did just that, but now I get errors when compiling, all related to
> >> the
> >> malloc operations.
> >>
> >> 1>Compiling...
> >> 1>TestSqlite.cpp
> >> 1>c:\documents and settings\las1pal\my documents\visual studio
> >> 2008\projects\sqlite3\sqlite3.c(12281) : error C2440: '=' : cannot
> >> convert
> >> from 'void *' to 'char *'
> > .
> > .
> > .
> > .
> >> ...
> >>
> >> Is it because I include a .c source file in a c++ project?
> >
> > Maybe - have you marked that 1 file as 'compile as c code'?
> >
> > (Properties -> C/C++ -> Advanced tab)
> >
> >>
> >> Thanks
> >>
> >
> > Regards,
> > Simon
> > ___
> > sqlite-users mailing list
> > sqlite-users@sqlite.org
> > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> >
> >
>
> --
> View this message in context:
> http://old.nabble.com/setup-sqlite-in-vc%2B%2B-tp29086729p2909.html
> Sent from the SQLite mailing list archive at Nabble.com.
>
> ___
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Reg: In Memory Database Using SQLite

2010-07-07 Thread Subhadeep Ghosh
Hello People,

I finally managed to create a wrapper around the SQLite core to support the
creation of in-memory databases. The wrapper comprises of three functions -
one to serialize the database, one to de-serialize a database and the third
one to do the cleanup job.

The function which serializes a database, copies the entire contents of the
database to a block of memory. The function which de-serializes takes a
block of memory as input and creates a database object out of it.

I am including the source code for the interested souls and I've not put
comments as I hate doing it.

I hope you guys find the code useful or at-least interesting.

Thank you and regards,
Subhadeep Ghosh.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Reg: In Memory Database Using SQLite

2010-07-06 Thread Subhadeep Ghosh
Hello People,

I was creating a server and a corresponding client application, in which the
I'm using SQLite for both the client and the server. The tricky part in this
setup is that the client is not required to store the database file with
itself, but it fetches it from the server, does whatever it needs to and
sends it back to the server (and the server stores it).

I'm aware that SQLite offers the functionality of in-memory databases, but I
don't know how to read the data and send it over the wire to the server or
how to push the data into the in-memory database of the server.

It would be great if someone could help me on this one.

Thank you and regards,
Subhadeep Ghosh.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users