Re: [sqlite] Tracking changes with sha1 hashes

2013-02-01 Thread Amit Chaudhuri
Excellent - thanks for the answer and the extra tip.  Good idea..

On Fri, Feb 1, 2013 at 3:38 PM, Igor Tandetnik  wrote:

> On 2/1/2013 10:21 AM, Amit Chaudhuri wrote:
>
>> If I only issue select queries on my two input databases, can I expect the
>> sha1 hash to stay the same over time?
>>
>
> Yes. You can even mark the database file as read-only and use
> sqlite3_open_v2 with SQLITE_OPEN_READONLY flag.
> --
> Igor Tandetnik
>
> __**_
> 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] Tracking changes with sha1 hashes

2013-02-01 Thread Igor Tandetnik

On 2/1/2013 10:21 AM, Amit Chaudhuri wrote:

If I only issue select queries on my two input databases, can I expect the
sha1 hash to stay the same over time?


Yes. You can even mark the database file as read-only and use 
sqlite3_open_v2 with SQLITE_OPEN_READONLY flag.

--
Igor Tandetnik

___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Tracking changes with sha1 hashes

2013-02-01 Thread Amit Chaudhuri
Hi all,

I want to finger print my data in a manner similar to that used with git.
They compute a sha1 hash of a collection of code expressed as text and use
that as a unique label for that code.  I was just about to write something
similar into a C application to compare two sqlite3 databases.  But I
started to wonder about meta-data and indices etc.

A little more background:

Database "one" has same structure as "two" but each may have different data
in rows.
Each month a new database comes out with potential changes to rows.
As the series grows I want to compare any two databases (e.g. January and
September).
Attach db one
Attach db two
Create db "compare" and copy data from one and two.
In compare, create new tables which contain the comparison data I want
(one.table left join two.table etc.)

If I only issue select queries on my two input databases, can I expect the
sha1 hash to stay the same over time? Maybe it would make more sense to
hash the data before it goes in the database.  But I thought I'd poll for
opinions.

Amit
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users