Re: [sqlite] Sometimes when my process restarts, it returns error "database is locked"

2014-07-14 Thread Mayank Kumar (mayankum)
The file system is ext3. I am calling this api sqlite3_config(SQLITE_CONFIG_LOG, errorLogCallback, NULL); and I expect the errorLogCallback to be called in error conditions to give more logs/diagnostics on what happened. In this callback as suggested I log the error code and the message.

Re: [sqlite] Preferred cast in C#

2014-07-14 Thread Random Coder
Could you not do something like this to handle the nullable types? T GetValue(string field) { object obj = reader[field]; if (obj is System.DBNull) return default(T); else return (T)obj; } Assuming the type is nullable, it should do

Re: [sqlite] capturing and testing a hot journal

2014-07-14 Thread William Drago
On 7/14/2014 6:38 PM, mm.w wrote: seriously? you should fix and solve why the soft crashed in the first place, reality check please. The software doesn't crash on its own; I'm forcing it to crash with a divide-by-zero for test purposes. This doesn't happen in actual use and there's no reason

Re: [sqlite] Selecting from view gives bad column information when view name is used in quotes in select statement

2014-07-14 Thread James K. Lowden
On Sun, 13 Jul 2014 22:45:27 +0200 Clemens Ladisch wrote: > > There is no contract of which column names should be returned, no > > "incorrect" headers and no guarantee, and no obligation from the > > standard or any other requirement. > > But these particular column names

Re: [sqlite] Selecting from view gives bad column information when view name is used in quotes in select statement

2014-07-14 Thread James K. Lowden
On Sun, 13 Jul 2014 22:54:52 +0100 Simon Slavin wrote: > > sqlite> select "TestView"."id", "TestView"."data2" from TestView; > > TestViewTestView > > -- -- > > 1 Miranda ... > It's also not 'wrong' with regard to the SQL specification. SQL

Re: [sqlite] Preferred cast in C#

2014-07-14 Thread Joseph L. Casale
> I would really love to have an easy way of putting a long? into the database, > and then getting a long? back out. What do you want to happen when the column is null as in your string example? jlc ___ sqlite-users mailing list

[sqlite] Preferred cast in C#

2014-07-14 Thread Edward Ned Harvey (sqlite)
I understand there are only 5 data types in Sqlite, and that the column type isn't necessarily the type of object returned in a query. Is there a more seamless way to cast responses than this? I would really love to have an easy way of putting a long? into the database, and then getting a

Re: [sqlite] Blocking on commit

2014-07-14 Thread Joseph L. Casale
> Rather than sleep, is their a blocking method I can accomplish a commit > through > or what other means can I assert all writes are complete? Missed the obvious, was a threading issue. jlc ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] capturing and testing a hot journal

2014-07-14 Thread mm.w
seriously? you should fix and solve why the soft crashed in the first place, reality check please. "But it is possible that Dropbox will copy a database and journal files that are not consistent with each other, which can create problems" fix the sync process, that's easy. Best. On Mon, Jul

Re: [sqlite] capturing and testing a hot journal

2014-07-14 Thread Drago, William @ MWG - NARDAEAST
This may be a bit simplistic, but it does give me a reasonable degree of confidence that hot journal files are being handled correctly in my application. I simply put a 1/0 on the line before my commit to purposely crash my app. Sure enough there's a journal file after the crash (I have a

Re: [sqlite] Brief intro to SQLite in Python

2014-07-14 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 13/07/14 14:05, Simon Slavin wrote: > But the examples of SQLite-via-Python code are clear and well written > and may be useful for Python users who want to learn SQLite. Sadly it neglects one huge surprising area. The sqlite3 module shipped with

[sqlite] Blocking on commit

2014-07-14 Thread Joseph L. Casale
I have a .net app where one thread runs a queue waiting for other threads to push data to persist. The underlying sqlite access is provided by a singleton class exposing only one connection. When I call commit on a transaction that has just written a bunch of data, this returns before the

Re: [sqlite] Selecting from view gives bad column information

2014-07-14 Thread RSmith
On 2014/07/14 17:50, Bruce Cowan wrote: RSmith wrote: There is no contract of which column names should be returned, no "incorrect" headers and no guarantee, and no obligation from the standard or any other requirement. If you need the returned names to be exactly something specific, then you

Re: [sqlite] Best approach for "notifications"

2014-07-14 Thread Simon Slavin
On 14 Jul 2014, at 5:00pm, João Ramos wrote: > The update hook says "The update hook implementation must not do anything > that will modify the database connection that invoked the update hook. Ah, right. Yes, you must store what you want your change to be in a variable

Re: [sqlite] Selecting from view gives bad column information

2014-07-14 Thread Bruce Cowan
I would add a couple more comments: No other ADO.NET data provider that is supported by OrmLite has this problem. All the others return column names that can be differentiated one from another without requiring an "AS" directive. Also, I don't think there is an "ADO.NET" standard as such, just

Re: [sqlite] Best approach for "notifications"

2014-07-14 Thread João Ramos
On Mon, Jul 14, 2014 at 3:57 PM, Simon Slavin wrote: > > The update hook function is an ideal way to do what you're doing. There > is also a pre-update hook: > > > > If you cannot use these, then my instinct is to

Re: [sqlite] Selecting from view gives bad column information

2014-07-14 Thread Bruce Cowan
RSmith wrote: >There is no contract of which column names should be returned, no "incorrect" >headers and no guarantee, and no obligation from the >standard or any other requirement. If you need the returned names to be >exactly something specific, then you need to use the "AS" >directive. I

Re: [sqlite] Best approach for "notifications"

2014-07-14 Thread Simon Slavin
On 14 Jul 2014, at 1:52pm, João Ramos wrote: > (for > example I know we cannot use sqlite3_update_hook to retrieve data) The update hook function is an ideal way to do what you're doing. There is also a pre-update hook:

[sqlite] Best approach for "notifications"

2014-07-14 Thread João Ramos
Hi, In a project I'm working on we need to have a mechanism that creates notifications when something happens in any given table. For example, for updates, we implemented something like: - create a ON UPDATE trigger in the target table - the trigger calls a custom function with every necessary

Re: [sqlite] capturing and testing a hot journal

2014-07-14 Thread Michael Schlenker
Am 14.07.2014 13:53, schrieb Kees Nuyt: > > On Mon, 14 Jul 2014 12:09:46 +0100, Simon Slavin > wrote: > >> On 14 Jul 2014, at 11:19am, Kees Nuyt wrote: >> >>> On Sun, 13 Jul 2014 18:00:59 +0100, Simon Slavin >>> wrote: >>> I

Re: [sqlite] capturing and testing a hot journal

2014-07-14 Thread Simon Slavin
On 14 Jul 2014, at 12:53pm, Kees Nuyt wrote: > Aha, I see. Yes, ill-behaving filesystems can do that. > The question is whether experiences on Windows 98 are still > relevant for rules of thumb in 2014. I mentioned Windows 98 to let you know how out-of-date my text was. I no

Re: [sqlite] capturing and testing a hot journal

2014-07-14 Thread Kees Nuyt
On Mon, 14 Jul 2014 12:09:46 +0100, Simon Slavin wrote: > On 14 Jul 2014, at 11:19am, Kees Nuyt wrote: > > > On Sun, 13 Jul 2014 18:00:59 +0100, Simon Slavin > > wrote: > > > >> I had to explain to some users that a database > >>

Re: [sqlite] capturing and testing a hot journal

2014-07-14 Thread Simon Slavin
On 14 Jul 2014, at 11:19am, Kees Nuyt wrote: > On Sun, 13 Jul 2014 18:00:59 +0100, Simon Slavin > wrote: > >> I had to explain to some users that a database >> change is not 'safe' until the database is closed. > > As far as I know, a database change

Re: [sqlite] Brief intro to SQLite in Python

2014-07-14 Thread Kees Nuyt
On Sun, 13 Jul 2014 22:05:29 +0100, Simon Slavin wrote: > A Python programmer was doing a lot of data processing in Python > and wondered whether SQLite could speed it up: > > > > The article and the database

Re: [sqlite] capturing and testing a hot journal

2014-07-14 Thread Kees Nuyt
On Sun, 13 Jul 2014 18:00:59 +0100, Simon Slavin wrote: > On 12 Jul 2014, at 9:37am, Charles Parnot wrote: > > - the journal file is actually not “hot” and I misunderstood > the conditions that make it hot > > That one. The files on disk aren't