Re: [sqlite] An interesting (strange) issue with selects

2012-06-23 Thread Pavel Ivanov
On Sat, Jun 23, 2012 at 10:36 PM, Dennis Volodomanov  wrote:
> On 24/06/2012 12:29 PM, Pavel Ivanov wrote:
>>
>> AFAIK, checkpoints are application-specific, but SQLite prohibits
>> second writer until first one committed its transaction and released
>> database lock. So there can't be such thing as "two writers, both
>> writing to the same DB". If one writer writes, another one is locked
>> out and waits. And btw checkpoint cannot be completed if there are
>> some application with transactions that started before last commit to
>> the database was made. Although partial checkpoint is possible in such
>> situation.
>
> Doesn't this suggest, though, that if the first writer crashes during a
> checkpoint, the second writer will be forever locked out? Or is there some
> internal mechanism that takes care of that?

Yes, internally SQLite uses OS-level file locks. When process crashes
or goes away by any other reason OS clears all locks it held, so other
writer sees database unlocked and is able to proceed.

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


Re: [sqlite] An interesting (strange) issue with selects

2012-06-23 Thread Dennis Volodomanov

On 24/06/2012 12:55 PM, Simon Slavin wrote:

Depending on the order and timing of how the two threads/processes run, 
something will eventually happen to your second writer.  It will probably reach 
whatever timeout you've set (which defaults to zero) and then return a result 
code indicating either 'locked' or 'busy'.  As the programmer it's your job to 
be checking your result codes and taking appropriate action, but if your 
application does crash out and you haven't closed your connections properly, 
SQLite will notice this the next time it opens the database, and what you'll 
see is everything rolled back to the last COMMITted transaction.


Yes, I do check for those codes and I have loops in the code to re-try 
the statement until it succeeds or too many retries occurs (but this is 
never hit in my case). So, if the db is busy, I Sleep(1) and retry. I'm 
not using the built-in busy handler.



You should be able to test this, using the sqlite3 shell utility tool, 
downloadable from the SQLite download page.  You can open two sessions in two 
windows and try to get one to lock the other out, or crash out of one session 
to see what happens to the other.  Or you could run your own app in one window, 
and use the shell tool to try to mess with your application and make it crash.  
Use a dummy test copy of your database, of course.

There are any number of ways to get SQLite to return error codes.  What has us 
concerned is that you are reporting that you've found a way to make SQLite 
return the wrong result /without/ returning an error code.  That's supposed to 
be impossible.


I'd probably be best off to write a simple program to do this. The idea 
is to have this program write to the DB, do a count and read from the db 
and report what it's reading/writing along with sql result codes. Then, 
run two instances of the app on the same db and crash one of those 
instances at random. I don't think I can do the same using the sqlite3 
shell utility and my main app is too large for constant testing like this.


I also wonder if my increased WAL size has anything to do with it (5000 
pages) - flushing will take longer than default, so there is more chance 
of things going wrong during the flush, I suppose?





I had transactions in my code previously, but I removed them after switching to 
WAL, so at least that's one less worry.

SQLite can only access a database inside a transaction (not only changes, but 
also SELECT).  If you issue a SQL command without having first issued a BEGIN, 
SQLite wraps your command inside a BEGIN … END structure.
I understand that, I meant I had explicit transactions surrounding 
multiple statements.


Dennis

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


Re: [sqlite] An interesting (strange) issue with selects

2012-06-23 Thread Simon Slavin

On 24 Jun 2012, at 3:36am, Dennis Volodomanov  wrote:

> On 24/06/2012 12:29 PM, Pavel Ivanov wrote:
>> AFAIK, checkpoints are application-specific, but SQLite prohibits
>> second writer until first one committed its transaction and released
>> database lock. So there can't be such thing as "two writers, both
>> writing to the same DB". If one writer writes, another one is locked
>> out and waits. And btw checkpoint cannot be completed if there are
>> some application with transactions that started before last commit to
>> the database was made. Although partial checkpoint is possible in such
>> situation.
> 
> Doesn't this suggest, though, that if the first writer crashes during a 
> checkpoint, the second writer will be forever locked out? Or is there some 
> internal mechanism that takes care of that?

Depending on the order and timing of how the two threads/processes run, 
something will eventually happen to your second writer.  It will probably reach 
whatever timeout you've set (which defaults to zero) and then return a result 
code indicating either 'locked' or 'busy'.  As the programmer it's your job to 
be checking your result codes and taking appropriate action, but if your 
application does crash out and you haven't closed your connections properly, 
SQLite will notice this the next time it opens the database, and what you'll 
see is everything rolled back to the last COMMITted transaction.

You should be able to test this, using the sqlite3 shell utility tool, 
downloadable from the SQLite download page.  You can open two sessions in two 
windows and try to get one to lock the other out, or crash out of one session 
to see what happens to the other.  Or you could run your own app in one window, 
and use the shell tool to try to mess with your application and make it crash.  
Use a dummy test copy of your database, of course.

There are any number of ways to get SQLite to return error codes.  What has us 
concerned is that you are reporting that you've found a way to make SQLite 
return the wrong result /without/ returning an error code.  That's supposed to 
be impossible.

> I had transactions in my code previously, but I removed them after switching 
> to WAL, so at least that's one less worry.

SQLite can only access a database inside a transaction (not only changes, but 
also SELECT).  If you issue a SQL command without having first issued a BEGIN, 
SQLite wraps your command inside a BEGIN … END structure.

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


Re: [sqlite] An interesting (strange) issue with selects

2012-06-23 Thread Dennis Volodomanov


On 24/06/2012 12:29 PM, Pavel Ivanov wrote:

AFAIK, checkpoints are application-specific, but SQLite prohibits
second writer until first one committed its transaction and released
database lock. So there can't be such thing as "two writers, both
writing to the same DB". If one writer writes, another one is locked
out and waits. And btw checkpoint cannot be completed if there are
some application with transactions that started before last commit to
the database was made. Although partial checkpoint is possible in such
situation.


Doesn't this suggest, though, that if the first writer crashes during a 
checkpoint, the second writer will be forever locked out? Or is there 
some internal mechanism that takes care of that?


I had transactions in my code previously, but I removed them after 
switching to WAL, so at least that's one less worry.


   Dennis

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


Re: [sqlite] An interesting (strange) issue with selects

2012-06-23 Thread Pavel Ivanov
On Sat, Jun 23, 2012 at 10:18 PM, Dennis Volodomanov  wrote:
> It does raise an interesting question though - how is this handled in SQLite
> internally? When there are two writers, both writing to the same DB (WAL
> mode) and one of them crashes before reaching a checkpoint, will the second
> writer pick up on that and checkpoint correctly? To put it simply - are
> checkpoints DB-specific or application-specific?

AFAIK, checkpoints are application-specific, but SQLite prohibits
second writer until first one committed its transaction and released
database lock. So there can't be such thing as "two writers, both
writing to the same DB". If one writer writes, another one is locked
out and waits. And btw checkpoint cannot be completed if there are
some application with transactions that started before last commit to
the database was made. Although partial checkpoint is possible in such
situation.

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


Re: [sqlite] An interesting (strange) issue with selects

2012-06-23 Thread Dennis Volodomanov

On 24/06/2012 11:38 AM, Pavel Ivanov wrote:
Such thing shouldn't ever happen, otherwise SQLite has a serious bug. 
Pavel 


It could be just my code of course. I guess I need to write a simple 
console app that simulates this to see if this guess is valid or not in 
the first place.


It does raise an interesting question though - how is this handled in 
SQLite internally? When there are two writers, both writing to the same 
DB (WAL mode) and one of them crashes before reaching a checkpoint, will 
the second writer pick up on that and checkpoint correctly? To put it 
simply - are checkpoints DB-specific or application-specific?


   Dennis

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


Re: [sqlite] An interesting (strange) issue with selects

2012-06-23 Thread Pavel Ivanov
On Sat, Jun 23, 2012 at 9:21 PM, Dennis Volodomanov  wrote:
> On 22/06/2012 9:48 AM, Dennis Volodomanov wrote:
>>
>> I'll see if the new compilation options still make this happen, but it
>> takes a couple of hours for each test due to data volume and I'd need to run
>> a few tests (unless it occurs right away of course). I'll post back.
>>
>
> This hasn't occurred yet, but I did manage to replicate this in another way
> (using the new compilation options) by stopping (in debug)/crashing the
> second writer process. It appears (albeit hard to say decisively) that the
> entry in the table that was written by the crashed process (and thus it's
> wal is not flushed) is the one that comes up in count, but can't be selected
> by the other process. Does this make sense or is it just a coincidence that
> I'm seeing?

Such thing shouldn't ever happen, otherwise SQLite has a serious bug.

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


Re: [sqlite] An interesting (strange) issue with selects

2012-06-23 Thread Dennis Volodomanov

On 22/06/2012 9:48 AM, Dennis Volodomanov wrote:
I'll see if the new compilation options still make this happen, but it 
takes a couple of hours for each test due to data volume and I'd need 
to run a few tests (unless it occurs right away of course). I'll post 
back.




This hasn't occurred yet, but I did manage to replicate this in another 
way (using the new compilation options) by stopping (in debug)/crashing 
the second writer process. It appears (albeit hard to say decisively) 
that the entry in the table that was written by the crashed process (and 
thus it's wal is not flushed) is the one that comes up in count, but 
can't be selected by the other process. Does this make sense or is it 
just a coincidence that I'm seeing?


Thanks!

   Dennis

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


Re: [sqlite] fetching rows

2012-06-23 Thread Pavel Ivanov
No, SQLite doesn't do auto-commits every 25k insertions. It does
auto-commit after each INSERT statement (no matter how many rows it
inserts). If you wrap several INSERT statements into transaction it
will execute faster.

Pavel


On Sat, Jun 23, 2012 at 3:13 PM, Durga D  wrote:
> Thank you(Pavel) for the prompt response.
>
> Sqlite does auto commit for every 25k insertions. Do I need to change the
> number from 25k to x ( for ex: 100)?
>
> On Thu, Jun 21, 2012 at 7:54 AM, Pavel Ivanov  wrote:
>
>> On Wed, Jun 20, 2012 at 11:33 PM, Durga D  wrote:
>> > Hi All,
>> >
>> >    I have to develop a sqlite application. Within the process, multiple
>> > threads are trying to access in write/read mode. Will sqlite supports
>> read
>> > and write at a time?
>> >
>> >    scenario:  1. x number of records (x related data) are going to insert
>> > in a transaction in ThreadA. still, not committed.
>> >                   2. In ThreadB (parallel thread), trying to read records
>> > (x related data), which are there in transaction.
>> >
>> >    By default, sqlite supports this scenario? or Do I need to enable any
>> > flags/macros?
>>
>> Yes, SQLite supports that. You can see some "problems" only if ThreadA
>> inserts a lot in one transaction, so that it doesn't fit into memory
>> cache.
>>
>>
>> Pavel
>> ___
>> 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] Different backend possible?

2012-06-23 Thread Pavel Ivanov
On Sat, Jun 23, 2012 at 2:28 PM, Simon Slavin  wrote:
> On 23 Jun 2012, at 7:14pm, "Peter M. Friedrich" 
>  wrote:
>
>> do you think it's possible to create a different backend? I want to
>> develop a relational database system which uses tables in FITS-files
>> (for details about this format see
>> http://fits.gsfc.nasa.gov/fits_standard.html). I guess it would be a
>> good idea to use an approved database like SQLite with a new backend -
>> in this case a different BTree-implementation.
>
> Two ways to do it.  You can create your own virtual table mechanism
>
> 
>
> or you can implement your own virtual file system
>
> 
>
> A third alternative is to jettison the SQLite name entirely and just to take 
> some of the source code that makes up SQLite and use it for your own software 
> which accesses FITS files.  You don't need any license to use any of the 
> SQLite source code, just use it and (for preference) credit the SQLite team 
> for supplying it.

Another option is to do that Berkeley DB way
(http://www.oracle.com/technetwork/products/berkeleydb/overview/index-085366.html).
They use SQLite's API, full SQL engine from SQLite and execute it on
their own implementation of BTree.


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


Re: [sqlite] fetching rows

2012-06-23 Thread Durga D
Thank you(Pavel) for the prompt response.

Sqlite does auto commit for every 25k insertions. Do I need to change the
number from 25k to x ( for ex: 100)?

On Thu, Jun 21, 2012 at 7:54 AM, Pavel Ivanov  wrote:

> On Wed, Jun 20, 2012 at 11:33 PM, Durga D  wrote:
> > Hi All,
> >
> >I have to develop a sqlite application. Within the process, multiple
> > threads are trying to access in write/read mode. Will sqlite supports
> read
> > and write at a time?
> >
> >scenario:  1. x number of records (x related data) are going to insert
> > in a transaction in ThreadA. still, not committed.
> >   2. In ThreadB (parallel thread), trying to read records
> > (x related data), which are there in transaction.
> >
> >By default, sqlite supports this scenario? or Do I need to enable any
> > flags/macros?
>
> Yes, SQLite supports that. You can see some "problems" only if ThreadA
> inserts a lot in one transaction, so that it doesn't fit into memory
> cache.
>
>
> Pavel
> ___
> 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] select ... where count(*)

2012-06-23 Thread giris

To: General Discussion of SQLite Database  
Sent: Saturday, June 23, 2012 1:21 PM
Subject: Re: [sqlite] select ... where count(*)
 

On Jun 23, 2012, at 7:19 PM, Patrik Nilsson wrote:

> Great! This works better than mine suggestion.

By the way… you might find the fine manual handy:

http://www.sqlite.org/lang.html

___
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] Different backend possible?

2012-06-23 Thread Simon Slavin

On 23 Jun 2012, at 7:14pm, "Peter M. Friedrich" 
 wrote:

> do you think it's possible to create a different backend? I want to
> develop a relational database system which uses tables in FITS-files
> (for details about this format see
> http://fits.gsfc.nasa.gov/fits_standard.html). I guess it would be a
> good idea to use an approved database like SQLite with a new backend -
> in this case a different BTree-implementation.

Two ways to do it.  You can create your own virtual table mechanism



or you can implement your own virtual file system



A third alternative is to jettison the SQLite name entirely and just to take 
some of the source code that makes up SQLite and use it for your own software 
which accesses FITS files.  You don't need any license to use any of the SQLite 
source code, just use it and (for preference) credit the SQLite team for 
supplying it.

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


Re: [sqlite] Different backend possible?

2012-06-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 23/06/12 11:14, Peter M. Friedrich wrote:
> do you think it's possible to create a different backend?

You can use the SQL frontend of SQLite with you providing the underlying
data by any appropriate means:

  http://www.sqlite.org/vtab.html

It isn't too easy to replace the btree and that sort of thing, although
you do have full control over how SQLite does store the database pages:

  http://www.sqlite.org/vfs.html

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk/mCXYACgkQmOOfHg372QQT6gCg3aSePHPFi53L6siIUuaJIJAy
MkIAnRsTg2o8O7B2nXI39p4X7LWKnT7M
=QKZR
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Different backend possible?

2012-06-23 Thread Peter M. Friedrich
Hi all,

do you think it's possible to create a different backend? I want to
develop a relational database system which uses tables in FITS-files
(for details about this format see
http://fits.gsfc.nasa.gov/fits_standard.html). I guess it would be a
good idea to use an approved database like SQLite with a new backend -
in this case a different BTree-implementation.

Regards,
Peter


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


Re: [sqlite] select ... where count(*)

2012-06-23 Thread Petite Abeille

On Jun 23, 2012, at 7:19 PM, Patrik Nilsson wrote:

> Great! This works better than mine suggestion.

By the way… you might find the fine manual handy:

http://www.sqlite.org/lang.html

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


Re: [sqlite] select ... where count(*)

2012-06-23 Thread Patrik Nilsson
Great! This works better than mine suggestion.
/Patrik

On 06/23/2012 07:12 PM, Petite Abeille wrote:
> 
> On Jun 23, 2012, at 6:55 PM, Patrik Nilsson wrote:
> 
>> select id,count(*) from repetitionhistory where count(id)<3 group by id
> 
> select id,count(*) from repetitionhistory group by id having count(id)<3 
> 
> ___
> 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] Fwd: select ... where count(*)

2012-06-23 Thread Patrik Nilsson
select a,b from (select id as a,count(id) as b from repetitionhistory
group by id) where b<3


 Original Message 
Subject: select ... where count(*)
Date: Sat, 23 Jun 2012 18:55:22 +0200
From: Patrik Nilsson 
To: General Discussion of SQLite Database 

Hi All,

I want to write a statement like: (gives error on "count",  misuse of
aggregate: count())

select id,count(*) from repetitionhistory where count(id)<3 group by id


This statement works when written without "where":

select id,count(*) from repetitionhistory group by id


But I'm only interested in those not being used many times.

Best regards,
Patrik





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


Re: [sqlite] select ... where count(*)

2012-06-23 Thread Petite Abeille

On Jun 23, 2012, at 6:55 PM, Patrik Nilsson wrote:

> select id,count(*) from repetitionhistory where count(id)<3 group by id

select id,count(*) from repetitionhistory group by id having count(id)<3 

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


[sqlite] select ... where count(*)

2012-06-23 Thread Patrik Nilsson
Hi All,

I want to write a statement like: (gives error on "count",  misuse of
aggregate: count())

select id,count(*) from repetitionhistory where count(id)<3 group by id


This statement works when written without "where":

select id,count(*) from repetitionhistory group by id


But I'm only interested in those not being used many times.

Best regards,
Patrik


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


Re: [sqlite] select count

2012-06-23 Thread Patrik Nilsson
Great! You solved my problem.
/Patrik

On 06/23/2012 06:28 PM, giris wrote:
> Hi:
> 
> 
> Assuming that the column in A is (for example) named x, the query will be
> 
> select count(*), x from A group by x
> 
> q.v "GROUP BY"
> 
> HTH.
> 
> Thanks
> 
> 
> 
>  From: Patrik Nilsson 
> To: General Discussion of SQLite Database  
> Sent: Saturday, June 23, 2012 12:24 PM
> Subject: [sqlite] select count
>  
> Hi All,
> 
> I have a table "a" which contains number like:
> 
> 1
> 1
> 1
> 1
> 2
> 2
> 4
> 
> When I "select distinct * from a" I get:
> 1
> 2
> 4
> 
> How can I get the count for each number? Like this:
> 1|4
> 2|2
> 4|1
> 
> How do I write the needed select statement?
> 
> Best regards,
> Patrik
> ___
> 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] select count

2012-06-23 Thread giris
Hi:


Assuming that the column in A is (for example) named x, the query will be

select count(*), x from A group by x

q.v "GROUP BY"

HTH.

Thanks



 From: Patrik Nilsson 
To: General Discussion of SQLite Database  
Sent: Saturday, June 23, 2012 12:24 PM
Subject: [sqlite] select count
 
Hi All,

I have a table "a" which contains number like:

1
1
1
1
2
2
4

When I "select distinct * from a" I get:
1
2
4

How can I get the count for each number? Like this:
1|4
2|2
4|1

How do I write the needed select statement?

Best regards,
Patrik
___
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] select count

2012-06-23 Thread Patrik Nilsson
Hi All,

I have a table "a" which contains number like:

1
1
1
1
2
2
4

When I "select distinct * from a" I get:
1
2
4

How can I get the count for each number? Like this:
1|4
2|2
4|1

How do I write the needed select statement?

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


Re: [sqlite] SQLite database on the android phone

2012-06-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 22/06/12 05:23, Pavel Ivanov wrote:
> And if you include your populated database into application package 
> before installation and don't see any data after installation check 
> that you open your database with an absolute path otherwise you could 
> be opening some other database file, not the one you think you're 
> opening.

Note that advice is not applicable to Android.  Android applications are
distributed as APK files which behind the scenes are just a zip file.
When your application is installed and running it is from that intact zip
file, although the contents feel as though they are local files.  SQLite
cannot open a database that is a member of a zipfile.  The application
would explicitly have to create the database on storage populating it via
SQL queries ideally.  You could also write the binary file image, but
Android is somewhat fussy about databases it didn't create as it does some
behind the scenes shenanigans with versioning and collations/locales.

Roger
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEARECAAYFAk/l7IoACgkQmOOfHg372QS8hgCfRi/ApEil2f/H5XwKPF/5Kaag
LSAAn3ZhZkUF9y2HJnOYiv/3/0gJjFvM
=tzSi
-END PGP SIGNATURE-
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users