[sqlite] SQLite database becomes corrupt on iOS

2015-08-19 Thread Scott Perry
On Aug 14, 2015, at 10:13 AM, Simon Slavin wrote: > On 14 Aug 2015, at 5:16pm, Random Coder wrote: >> I've run into other issues >> that lead me to believe the OS is caching file writes until the app >> exits in some situations regardless of various sync calls, but I never >> did have time to tra

[sqlite] System.Data.SQLite version 1.0.98.0 released

2015-08-19 Thread Steffen Mangold
> > System.Data.SQLite version 1.0.98.0 (with SQLite 3.8.11.1) is now available > on the System.Data.SQLite website: > Great news, thanks Joe!! Regards Steffen

[sqlite] ATTACH DATABASE statement speed

2015-08-19 Thread Paolo Bolzoni
On Wed, Aug 19, 2015 at 11:44 AM, Simon Slavin wrote: > Hmm. Would it be possible to format an external drive in ZFS and try the > operations on files stored on that ? As you might have guessed from the timezone I am not at home atm, so I do not have spare external disks. However, I do have an

[sqlite] ATTACH DATABASE statement speed

2015-08-19 Thread Paolo Bolzoni
I see. Thanks nameless person known as sqlite-mail (npkasm for short), what you say makes sense. However it does not explain why the pragma checks are so slow. Anyhow, npkasm, I will keep in mind for the future. Good point indeed. On Wed, Aug 19, 2015 at 3:59 PM, sqlite-mail wrote: > Hello ! >

[sqlite] Getting row number in a sorted list.

2015-08-19 Thread R.Smith
> > SELECT count(sub.Name) + 1 AS Rank, a.Name > FROM NameTable AS a LEFT OUTER JOIN NameTable AS sub ON sub.Name < > a.Name > WHERE a.Name LIKE 'P%' > GROUP BY a.Name > ORDER BY a.Name > LIMIT 1 > > > -- Rank | Name > -- | -- > -- 4 | PQRS I shou

[sqlite] Getting row number in a sorted list.

2015-08-19 Thread R.Smith
On 2015-08-19 03:02 PM, John McKown wrote: > On Wed, Aug 19, 2015 at 7:40 AM, Simon Slavin wrote: > >> 1|ABCD >> 2|CDE >> 4|AXN >> 5|AXN2 >> 6|PQRS2 >> sqlite> select rowid from NameTable where Name between 'P' and 'PZZZ' >> limit 1; >> 6 >> >> >> Hum, that probably isn't what the OP wanted.

[sqlite] Getting row number in a sorted list.

2015-08-19 Thread Simon Slavin
On 19 Aug 2015, at 2:00pm, R.Smith wrote: > Seriously though, if that column is not COLLATE NOCASE declared, 'PZZZ' will > fail. Either ensure your column has COLLATE NOCASE or perhaps simply choosing > the highest (non UTF-8) character such as: > > WHERE name BETWEEN 'P' AND 'P~' > >

[sqlite] Getting row number in a sorted list.

2015-08-19 Thread Clemens Ladisch
Simon Slavin wrote: > SELECT rowid FROM NameTable > WHERE name BETWEEN 'P' AND 'P' > > This will execute faster if you have an index on 'name' in NameTable. > > [Yes I know 'P' is lazy. Until you find someone with that name > (presumably Polish) with that name bite me.] If the colu

[sqlite] Getting row number in a sorted list.

2015-08-19 Thread R.Smith
On 2015-08-19 02:40 PM, Simon Slavin wrote: > > SELECT rowid FROM NameTable > WHERE name BETWEEN 'P' AND 'P' > ORDER BY name > LIMIT 1 > > This will execute faster if you have an index on 'name' in NameTable. > > [Yes I know 'P' is lazy. Until you find someone with that

[sqlite] .NET - Using SQLite in an Universal Windows library without LINQ

2015-08-19 Thread Saurav Sarkar
Hi Mat, We have been using SQLite in our Windows universal application both for tablet and phone We used SQlitePCL as the wrapper library to write our queries in plain sql . check for more details here http://codifyit.blogspot.in/2015/04/using-sqlite-in-your-windows-store-apps.html cheers, Saur

[sqlite] do temporary on-disk databases get cleaned up on abnormal process termination?

2015-08-19 Thread Simon Slavin
On 19 Aug 2015, at 1:44pm, Richard Hipp wrote: > On Unix, unlink() after open is used. > > On Windows, the FILE_FLAG_DELETE_ON_CLOSE flags is used when the > temporary file is opened. I was wrong. Apologies. Simon.

[sqlite] Getting row number in a sorted list.

2015-08-19 Thread Simon Slavin
On 19 Aug 2015, at 1:16pm, Anthrathodiyil, Sabeel (S.) wrote: > Example, for below entries in NameTable > > Name > > 1. PTN > > 2. ABCD > > 3. CDE > > 4. PQRS > > 5. AXN > > > I want to get the row number of the first name that starts with 'P' in the > sort

[sqlite] do temporary on-disk databases get cleaned up on abnormal process termination?

2015-08-19 Thread Simon Slavin
On 19 Aug 2015, at 1:36pm, Keith Medcalf wrote: > Meaning that on a persistent temp storage the files will stay forever (or > until a manually deleted). Then again, on systems such as windows where temp > files are never deleted this is to be expected. Hmm. On every Unix box I've seen /tmp

[sqlite] do temporary on-disk databases get cleaned up on abnormal process termination?

2015-08-19 Thread Simon Slavin
On 18 Aug 2015, at 8:40pm, Sam Roberts wrote: > The docs say you have to close the DB handle to clean them up. I'm > concerned that if a process is SIGKILLed or just exits abruptly that > the temporary DBs will accumulate on disk. > > What mechanism is used to create the temporary files? If the

[sqlite] Getting row number in a sorted list.

2015-08-19 Thread Anthrathodiyil, Sabeel (S.)
Hi, I have a database with NameTable having name records in it, I need to get the row number of the first record in the sorted list of names for which the search name matches. Example, for below entries in NameTable Name 1. PTN 2. ABCD 3. CDE 4. PQRS 5. AXN

[sqlite] System.Data.SQLite version 1.0.98.0 released

2015-08-19 Thread Joe Mistachkin
System.Data.SQLite version 1.0.98.0 (with SQLite 3.8.11.1) is now available on the System.Data.SQLite website: https://system.data.sqlite.org/ Further information about this release can be seen at: https://system.data.sqlite.org/index.html/doc/trunk/www/news.wiki Please post on the S

[sqlite] ATTACH DATABASE statement speed

2015-08-19 Thread Steffen Mangold
> > is there any target date when the preRelease branch gets over to a actual > release? > > Is a really hard show stopper for our development at the moment. We checked > everything for compatibility before merge your current trunk to Visual > Studio 2015 and we forget about the SQLite design

[sqlite] System.Data.SQLite 1.0.98.0 release

2015-08-19 Thread Steffen Mangold
Hi, is there any target date when the preRelease branch gets over to a actual release? Is a really hard show stopper for our development at the moment. We checked everything for compatibility before merge your current trunk to Visual Studio 2015 and we forget about the SQLite design tool. :(

[sqlite] ATTACH DATABASE statement speed

2015-08-19 Thread Steffen Mangold
Hi, is there any target date when the preRelease branch gets over to a actual release? Is a really hard show stopper for our development at the moment. We checked everything for compatibility before merge your current trunk to Visual Studio 2015 and we forget about the SQLite design tool. :(

[sqlite] SQLite database in a Windows CE6.0 mobile device

2015-08-19 Thread J Trahair
Hi I am trying to run a SQLite database in a CE6.0 device (Psion Omnii XT15). It runs the demo from sqlite-netFx35-binary-PocketPC-ARM-2008-1.0.97.0.zip, which creates a db from testce.exe, but on running my VB.net app it produces an error message - File or assembly name Microsoft.VisualBasic V

[sqlite] ATTACH DATABASE statement speed

2015-08-19 Thread Paolo Bolzoni
@Simon I tried zpool scrub on both my disks and it returned nothing, I also tried executing stress[1] on the disk and no error appeared in the log or in stress itself. However, coping the sqlite db on an external disk connected via usb3 and formatted with Ntfs actually does the pragma quick_check i

[sqlite] ATTACH DATABASE statement speed

2015-08-19 Thread Simon Slavin
On 19 Aug 2015, at 10:46am, Paolo Bolzoni wrote: > As you might have guessed from the timezone I am not at home atm, so I > do not have spare external disks. > However, I do have an expendable 16BG usb stick so I tried on that. > > First I formatted it using zfs and I did the Pragma quick_chec

[sqlite] .NET - Using SQLite in an Universal Windows library without LINQ

2015-08-19 Thread Mathieu Sicard
Hi, I was previously using System.Data.SQLite in a .NET library, and now want to port this library to an Universal Windows library. I cannot make the System.Data.SQLite work (since I guess it is not portable), and found only LINQ style SQLite PCL libraries in NuGet ... Is there a way that I can

[sqlite] pragma temp_store_directory is deprecated, what is the alternative?

2015-08-19 Thread Paolo Bolzoni
Wouldn't be easier to simply add a parameter to sqlite3_initialize()? E.g., a char const pointer to the tmp directory? That, if null, defaults to something reasonable as James mentioned? Maybe I am oversensitive, but I found strange I have to use setenv to setup a command line option about "where

[sqlite] ATTACH DATABASE statement speed

2015-08-19 Thread sqlite-mail
Hello ! The problem with foreign keys most of the time is not the the referenced table/field (normally primary key that do no need extra index) but the dependent table/field when they do not have a proper index, any time you update/delete a record on the referenced table a linear scan is perform

[sqlite] do temporary on-disk databases get cleaned up on abnormal process termination?

2015-08-19 Thread Richard Hipp
On 8/18/15, Sam Roberts wrote: > What mechanism is used to create the temporary files? On Unix, unlink() after open is used. On Windows, the FILE_FLAG_DELETE_ON_CLOSE flags is used when the temporary file is opened. -- D. Richard Hipp drh at sqlite.org

[sqlite] Getting row number in a sorted list.

2015-08-19 Thread John McKown
On Wed, Aug 19, 2015 at 7:40 AM, Simon Slavin wrote: > > On 19 Aug 2015, at 1:16pm, Anthrathodiyil, Sabeel (S.) < > santhrat at visteon.com> wrote: > > > Example, for below entries in NameTable > > > > Name > > > > 1. > ?? > PTN > > > > 2. ABCD > > > > 3. CDE > > > > 4. PQRS >

[sqlite] do temporary on-disk databases get cleaned up on abnormal process termination?

2015-08-19 Thread Keith Medcalf
> On 19 Aug 2015, at 1:36pm, Keith Medcalf wrote: > > Meaning that on a persistent temp storage the files will stay forever > (or until a manually deleted). Then again, on systems such as windows > where temp files are never deleted this is to be expected. > Hmm. On every Unix box I've seen /

[sqlite] do temporary on-disk databases get cleaned up on abnormal process termination?

2015-08-19 Thread Keith Medcalf
> Some temporary files have fixed names so they will be replaced the next > time SQLite tries to perform the same operation, and deleted when that one > finishes. Others will just hang about until the computer is rebooted and > will be deleted with other temporary files either on shutdown or on >

[sqlite] System.Data.SQLite 1.0.98.0 release

2015-08-19 Thread Joe Mistachkin
If everything goes as planned, it should be out later today (US Pacific Time). Sent from my iPhone > On Aug 19, 2015, at 4:37 AM, Steffen Mangold powerdoo.com> wrote: > > Hi, > > is there any target date when the preRelease branch gets over to a actual > release? > > Is a really hard show s

[sqlite] ATTACH DATABASE statement speed

2015-08-19 Thread Simon Slavin
On 19 Aug 2015, at 3:27am, Paolo Bolzoni wrote: > coping the sqlite db on an external disk connected via usb3 > and formatted with Ntfs actually does the pragma quick_check in little > more than 20 seconds and pragma integrity_check in 5 minutes. Those times are completely typical for SQLite.

[sqlite] pragma temp_store_directory is deprecated, what is the alternative?

2015-08-19 Thread Simon Slavin
On 19 Aug 2015, at 1:28am, Paolo Bolzoni wrote: > Wouldn't be easier to simply add a parameter to sqlite3_initialize()? > E.g., a char const pointer to the tmp directory? That, if null, > defaults to something reasonable as James mentioned? The correct place for temp files varies from computer