[sqlite] Reader.GetBytes() - when is a byte not a byte?

2015-07-02 Thread Drago, William @ CSG - NARDA-MITEQ
Lots of good replies. My problem is solved, thank you. My assumption was that GetBytes() could be used to read the bytes of any column regardless of type. What difference should column type or affinity make if I'm asking for bytes? If I'm using GetBytes() on a column with REAL affinity, it

[sqlite] Reader.GetBytes() - when is a byte not a byte?

2015-07-02 Thread Jean Chevalier
It's not mandatory to use x'' notation to insert into a blob, when one can use cast. The following should return blob content correctly without explicitly lying it down as Hex: sqlite> create table T (c blob check(typeof(c) = 'blob')); sqlite> insert into T values ( cast('x y z' as blob) );

[sqlite] Could frequent 'database is locked' errors mean SQLite is not a good fit for my application?

2015-07-02 Thread Kathleen Alexander
Thanks so much for the help. I set the timeout to 5 seconds (at each instance of a db open connection) and was still seeing the database locked errors with some frequency (haven't quantified it yet), so I will try extending it to 30 seconds, as you suggest, and hopefully that makes a difference.

[sqlite] Could frequent 'database is locked' errors mean SQLite is not a good fit for my application?

2015-07-02 Thread Igor Korot
Hi, Kathleen, On Thu, Jul 2, 2015 at 5:34 PM, James K. Lowden wrote: > On Thu, 2 Jul 2015 10:09:12 -0400 > Kathleen Alexander wrote: > >> Essentially, I have written an application in C++ that interfaces >> (reads and writes) with a SQLite database, and I am getting lots of >> 'database is

[sqlite] Could frequent 'database is locked' errors mean SQLite is not a good fit for my application?

2015-07-02 Thread James K. Lowden
On Thu, 2 Jul 2015 10:09:12 -0400 Kathleen Alexander wrote: > Essentially, I have written an application in C++ that interfaces > (reads and writes) with a SQLite database, and I am getting lots of > 'database is locked' errors. [...] > > My application runs on Linux (ubuntu 13.10), and is

[sqlite] Weird FTS bugs (wrong, missing and false positive results)

2015-07-02 Thread shuricks...@ukr.net
We use SQLite for indexing and searching the text contents of our app using FTS4 (about 27k unique words, about 1 million words for the whole contents). In particular, we use the offsets function. Currently, after some testing, we?re experiencing a plenty of problems with finding the results

[sqlite] Slow real world performance - Any suggestions please (warning long)

2015-07-02 Thread Ward Willats
> On Jul 2, 2015, at 3:16 PM, Rob Willett > wrote: > > We?re trying to understand whether or not we have a performance problem with > our Sqlite database. It may or may not apply to your situation, but after doing lots of inserts, running ANALYZE can sometimes work wonders. -- Ward

[sqlite] Reader.GetBytes() - when is a byte not a byte?

2015-07-02 Thread R.Smith
On 2015-07-02 03:24 PM, R.Smith wrote: > That exception is only thrown if the source column is not a BLOB (as > far as I can tell). > > You specify the column Type (or type affinity) as BLOB but then you > store a non-BLOB TEXT value in it ('"blue" "red" "orange" "yellow"' > <-- Not a BLOB) >

[sqlite] Could frequent 'database is locked' errors mean SQLite is not a good fit for my application?

2015-07-02 Thread Simon Davies
On 2 July 2015 at 15:09, Kathleen Alexander wrote: > Hi, > > I apologize if this is an incorrect forum for this question, but I am > pretty new to SQLite and have been unable to resolve this issue through > other searches. Feel free to direct me to a more appropriate forum. > > Essentially, I

[sqlite] Reader.GetBytes() - when is a byte not a byte?

2015-07-02 Thread R.Smith
That exception is only thrown if the source column is not a BLOB (as far as I can tell). You specify the column Type (or type affinity) as BLOB but then you store a non-BLOB TEXT value in it ('"blue" "red" "orange" "yellow"' <-- Not a BLOB) SQLite will store this as TEXT, not BLOB. A BLOB

[sqlite] Compiling sqlite as as library

2015-07-02 Thread Prakash Premkumar
I tried with the following flags : gcc -arch x86_64 -o sqlite3.o sqlite3.c shell.c and > gcc -m32 -o sqlite3.o sqlite3.c shell.c but both results in the same error. Can you please help me solve this ? On Thu, Jul 2, 2015 at 2:47 PM, Andy Ling wrote: > > I get the following error

[sqlite] Compiling sqlite as as library

2015-07-02 Thread Prakash Premkumar
Hi Andy, I get the following error while trying to compile after linking with the library ld: warning: ignoring file > /Users/prakash-2282/Downloads/sqlite-amalgamation-201506301510/libsqlite3.a, > file was built for archive which is not the architecture being linked > (x86_64): >

[sqlite] Reader.GetBytes() - when is a byte not a byte?

2015-07-02 Thread Jean Chevalier
Please provide your code context, as in, http://stackoverflow.com/questions/10746237/sqlite-in-c-sharp-throws-invalidcastexception-using-getbytes Today, Bill wrote: > > All, > Below is a .dump of the database I'm working with. I can use > GetBytes() successfully on all the BLOB columns except >

[sqlite] Compiling sqlite as as library

2015-07-02 Thread Prakash Premkumar
Thanks a ton Andy for your reply. can you specify how I should specify the include flags (-I). The kore build complais that "sqlite3.h" header file is not found . Thanks a lot for your time On Thu, Jul 2, 2015 at 1:51 PM, Andy Ling wrote: > > Can you please tell me how to compile it as a

[sqlite] Reader.GetBytes() - when is a byte not a byte?

2015-07-02 Thread Simon Slavin
On 2 Jul 2015, at 12:47pm, William Drago wrote: > Below is a .dump of the database I'm working with. I can use GetBytes() > successfully on all the BLOB columns except myTextArray. On that column I get > a System.InvalidCastException error. Can anyone tell me why? Thanks. SQLite has no

[sqlite] Could frequent 'database is locked' errors mean SQLite is not a good fit for my application?

2015-07-02 Thread Kathleen Alexander
Hi Adam, Thank you very much for your response. I had not considered using copies of the database. In my method there are cases where writes to the database by one process may be relevant to another process, so I'm not sure that that would be a good option. I don't explicitly set

[sqlite] Compiling sqlite as as library

2015-07-02 Thread Amit Chaudhuri
Maybe this will help? http://stackoverflow.com/questions/4234767/how-do-i-build-sqlite3-from-command-line On Thu, Jul 2, 2015 at 10:25 AM, Prakash Premkumar wrote: > I tried with the following flags : > > gcc -arch x86_64 -o sqlite3.o sqlite3.c shell.c > > > and > > >> gcc -m32 -o sqlite3.o

[sqlite] Could frequent 'database is locked' errors mean SQLite is not a good fit for my application?

2015-07-02 Thread Adam Devita
Good day, I'm sure others on the list will add better insight, but is your task parallel enough that your nodes can work with a copy of the database and submit changes the one the others copy from when 'done' their calculation? Are you using https://www.sqlite.org/c3ref/busy_timeout.html ?

[sqlite] Weird FTS bugs (wrong, missing and false positive results)

2015-07-02 Thread Kevin Benson
FTFY, you're welcome ;-) Now *MAYBE* someone can read it and possibly reply. -- -- -- --???-- K e V i N On Thu, Jul 2, 2015 at 9:11 AM, wrote: > We use SQLite for indexing and searching the text contents of our app > using FTS4 > (about 27k unique words, about 1

[sqlite] Compiling sqlite as as library

2015-07-02 Thread Prakash Premkumar
Thanks for your reply Kees. I am using kore web server and I want to pass sqlite library in the LDFLAGS option to the kore webserver. ( https://kore.io/doc/#cli ) For this purpose, I would like to compile it as a library, I wont be able to pass the sqlite3.c in the list of sources. Can you

[sqlite] Could frequent 'database is locked' errors mean SQLite is not a good fit for my application?

2015-07-02 Thread Kathleen Alexander
Hi, I apologize if this is an incorrect forum for this question, but I am pretty new to SQLite and have been unable to resolve this issue through other searches. Feel free to direct me to a more appropriate forum. Essentially, I have written an application in C++ that interfaces (reads and

[sqlite] Compiling sqlite as as library

2015-07-02 Thread Andy Ling
> I tried with the following flags : > > gcc -arch x86_64 -o sqlite3.o sqlite3.c shell.c > > > and > > > > gcc -m32 -o sqlite3.o sqlite3.c shell.c > > > but both results in the same error. > > Can you please help me solve this ? > It's getting outside my level of expertise (and not

[sqlite] Compiling sqlite as as library

2015-07-02 Thread Andy Ling
> I get the following error while trying to compile after linking with the > library > > ld: warning: ignoring file > > /Users/prakash-2282/Downloads/sqlite-amalgamation- > 201506301510/libsqlite3.a, > > file was built for archive which is not the architecture being linked > > (x86_64): > >

[sqlite] Compiling sqlite as as library

2015-07-02 Thread Andy Ling
> Thanks a ton Andy for your reply. > > can you specify how I should specify the include flags (-I). > The kore build complais that "sqlite3.h" header file is not found . > Sounds like you need to read a few more manuals :^) Normally there are compiler options that let you tell it which

[sqlite] Compiling sqlite as as library

2015-07-02 Thread Andy Ling
> Can you please tell me how to compile it as a library on Mac OSX and Linux > platforms ? > Use your favourite compiler to generate sqlite3.o then use ar to wrap that up as a .a file. Give that file a name something like libsqlite3.a and you will be able to add -Lsqlite3 to your LDFLAGS. The

[sqlite] Could frequent 'database is locked' errors mean SQLite is not a good fit for my application?

2015-07-02 Thread Jim Morris
If you are not using WAL mode that might help. On 7/2/2015 7:59 AM, Kathleen Alexander wrote: > Hi Adam, > > Thank you very much for your response. I had not considered using copies of > the database. In my method there are cases where writes to the database by > one process may be relevant to

[sqlite] Reader.GetBytes() - when is a byte not a byte?

2015-07-02 Thread William Drago
All, Below is a .dump of the database I'm working with. I can use GetBytes() successfully on all the BLOB columns except myTextArray. On that column I get a System.InvalidCastException error. Can anyone tell me why? Thanks. -Bill ---.dump file--- PRAGMA foreign_keys=OFF; BEGIN