[sqlite] How to read data from WAL?

2016-03-08 Thread Donald Griggs
Sairam, Just in case it's useful and you've not see it, Simon Slavin pointed out this "rqlite" project for replicated sqlite in an email from 25 Feb. Donald Simon Slavin slavins at bigfraud.org via

[sqlite] How to read data from WAL?

2016-03-07 Thread Sairam Gaddam
> I have done some manual WAL decoding for my forensic software that can > identifiy a previous DB state - its fun :)... > > (From memory) > > To determine which pages belong to the last transaction, you need to : > > Read the WAL header to obtain the current salt, then read each wal > frame to

[sqlite] How to read data from WAL?

2016-03-07 Thread Sairam Gaddam
> > Sounds to me you want to implement logical decoding, that is to > extract an SQL form from the binary WAL format. > I don't believe SQLite provides such a feature, that is something > other databases use for bidirectional replication. I just want to know which tables and rows are changed

[sqlite] How to read data from WAL?

2016-03-07 Thread Sairam Gaddam
> > To achieve what goal? > > In any case, perhaps https://www.sqlite.org/rbu.html is of interest to > you. > I want to make note of those changes and replicate in another DB. And I found that WAL is the correct place where changes to the database are present. So my main aim is to get those

[sqlite] How to read data from WAL?

2016-03-07 Thread Sairam Gaddam
> > If you're really sure that the database files are identical, the easiest > way to do the replication would be to copy the WAL file. > > What processing do you want to do? > I want to take note of changes and depending on data, I might replicate in some other DB. The database files are not

[sqlite] How to read data from WAL?

2016-03-07 Thread Simon Slavin
On 7 Mar 2016, at 12:24pm, Sairam Gaddam wrote: > I want to make note of those changes and replicate in another DB. Okay. Reading changes from the WAL file is perhaps a poor way to do this. First, not all SQLite databases have a WAL file. Second, SQLite can put changes in the WAL file and

[sqlite] How to read data from WAL?

2016-03-07 Thread Sairam Gaddam
> > This requires detailed knowledge of how SQLite works. If the file format > page I referred you to does not help you may have to study the SQLite > source code to find out what you need. > Yeah I read the source file wal.c and based on what I read, SQLite syncs the frames which have page data

[sqlite] How to read data from WAL?

2016-03-07 Thread Sairam Gaddam
My main aim is to find the fresh changes which are to be made to database through WAL module. How is data stored in WAL? If the data is stored in pages inside WAL then how to see the changes which are presently made to the database? Should I decrypt the information from WAL to know the changes

[sqlite] How to read data from WAL?

2016-03-07 Thread Dominique Devienne
On Mon, Mar 7, 2016 at 6:52 AM, Sairam Gaddam wrote: > My main aim is to find the fresh changes which are to be made to database > through WAL module. > To achieve what goal? In any case, perhaps https://www.sqlite.org/rbu.html is of interest to you. --DD

[sqlite] How to read data from WAL?

2016-03-07 Thread Luca Ferrari
On Mon, Mar 7, 2016 at 7:55 AM, Sairam Gaddam wrote: > And the decryption here I mean is to get information from those pages(like > on which table, which column a change is made etc.,) which involves reading > the page to get the changes which are presently made. Sounds to me you want to

[sqlite] How to read data from WAL?

2016-03-07 Thread Paul Sanderson
I have done some manual WAL decoding for my forensic software that can identifiy a previous DB state - its fun :)... (From memory) To determine which pages belong to the last transaction, you need to : Read the WAL header to obtain the current salt, then read each wal frame to determine which

[sqlite] How to read data from WAL?

2016-03-07 Thread Clemens Ladisch
Sairam Gaddam wrote: > I want to make note of those changes and replicate someplace else. And I > found that WAL is the correct place where changes to the database are > present. So my main aim is to get those changes and replicate after further > processing. If you're really sure that the

[sqlite] How to read data from WAL?

2016-03-07 Thread Simon Slavin
On 7 Mar 2016, at 5:52am, Sairam Gaddam wrote: > How is data stored in WAL? You can learn about the data format for the WAL file in section 4.0 of this page: > If the data is stored in pages inside WAL then how to see the changes which > are