[sqlite] PhoneGap with SQLite Encryption Extension?
Thank you -Original Message- From: sqlite-users-bounces at mailinglists.sqlite.org [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On Behalf Of Richard Hipp Sent: Friday, December 04, 2015 16:50 To: SQLite mailing list Cc: Santinello, Anthony Subject: Re: [sqlite] PhoneGap with SQLite Encryption Extension? On 12/4/15, Ribeiro, Glauber wrote: > We have an Android application built on PhoneGap, which uses the built-in > SQLite to store data. > > Does anybody here know if it's possible to replace the built-in SQLite in > PhoneGap (Android) with a version that supports encryption (S.E.E. or other > kind), so that the application information would be transparently > encrypted? > You'll have to compile in your own copy of SQLite using the JNI. Instructions here: http://www.sqlite.org/android/doc/trunk/www/index.wiki -- D. Richard Hipp drh at sqlite.org ___ sqlite-users mailing list sqlite-users at mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] PhoneGap with SQLite Encryption Extension?
We have an Android application built on PhoneGap, which uses the built-in SQLite to store data. Does anybody here know if it's possible to replace the built-in SQLite in PhoneGap (Android) with a version that supports encryption (S.E.E. or other kind), so that the application information would be transparently encrypted? Thanks, glauber
Re: [sqlite] Why are allowed to keep a text of 3 characters in a field that has been set to 2?
-Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Angus March Sent: Tuesday, September 22, 2009 8:40 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Why are allowed to keep a text of 3 characters in a field that has been set to 2? One thing that I haven't been able to find explicitly is there is no advantage to using CHAR(2). In my db I have blobs and strings that are of an exact length, but I don't bother declaring them as anything but BLOB and TEXT, since I don't expect it'll optimize anything. So can someone confirm for me that CHAR(2) does nothing for efficiency and everything for compatibility? [[glauber]] Correct. It's useful for documentation purposes only. g ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Importing data into SQLite - text files are not really portable
Unfortunately, the 3 main families of small computer operating systems have 3 different definitions of what a text file is... DOS/Windows (PC): lines are terminated with CR+LF Unix: lines are terminated with LF Macintosh: lines are terminated with CR This causes no end of trouble when moving text files between these kinds of systems. Java takes the approach that any of (CR, LF, or CR+LF) is a valid line terminator, but many or perhaps most non-Java software insists on having the correct line terminator for the platform where it's running. g -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Kavita Raghunathan Sent: Tuesday, September 08, 2009 2:14 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Importing data into SQLite FYI: Mac excel does not separate rows with \r, but inserts a ^M instead. (I dont have a windows machine with me, I wonder if this is Mac specific) Sqlite does not like this because a large file with many rows appears as 1 huge infinite line to sqlite. Kavita - Original Message - From: "Kavita Raghunathan"To: "General Discussion of SQLite Database" Sent: Tuesday, September 8, 2009 11:47:38 AM GMT -08:00 US/Canada Pacific Subject: Re: [sqlite] Importing data into SQLite Yes, this works. Must have been my original csv file. I was using mac based excel and I'll now try using the windows based excel. Thanks to all for the awesome support. Kavita SQLite version 3.3.6 Enter ".help" for instructions sqlite> create table test(name text, id integer); sqlite> .separator "," sqlite> .import data.csv test sqlite> sqlite> select * from test ...> ; "a",1 "b",2 "c",3 sqlite> Original Message - From: "Robert Citek" To: "General Discussion of SQLite Database" Sent: Monday, September 7, 2009 9:08:41 AM GMT -08:00 US/Canada Pacific Subject: Re: [sqlite] Importing data into SQLite On Sun, Sep 6, 2009 at 9:32 PM, Kavita Raghunathan wrote: > Timothy and all, > When I try to import a .csv, I get a segmentation fault: > 1) First I set .seperator to , > 2) Then I type .import > 3) I see "Segmentation fault" > > Any ideas ? Here's an example of how it worked for me. $ cat data.csv "a",1 "b",2 "c",3 $ sqlite3 sample.db .schema CREATE TABLE data (foo text, bar int); $ sqlite3 -separator , sample.db '.imp "data.csv" "data" ' $ sqlite3 -header -column sample.db 'select * from data ;' foo bar -- -- "a" 1 "b" 2 "c" 3 More details here, including caveats: http://www.sqlite.org/cvstrac/wiki?p=ImportingFiles Personally, I prefer to used tab-delimited files and then import by specifying the separator as a tab: $ sqlite3 -separator $'\t' sample.db '.imp "data.tsv" "data" ' This takes advantage of the bash shell's use of $'\t' to encode a tab. Regards, - Robert ___ 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 ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] SQLJet - pure Java implementation of SQLite andNestedVM version
Or else, what's throwing me off is this, in http://www.zentus.com/sqlitejdbc/ "Both the pure driver and the native binaries for Windows, Mac OS X, and Linux x86 have been combined into a single jar file." [...] "Pure Java driver, always works, slowly." g -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Ribeiro, Glauber Sent: Wednesday, August 12, 2009 4:35 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLJet - pure Java implementation of SQLite andNestedVM version I had the impression that the NestedVM version worked under Linux only, is this incorrect? g -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Roger Binns Sent: Wednesday, August 12, 2009 3:54 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLJet - pure Java implementation of SQLite -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Fred Williams wrote: > I seem to remember, haven't done it in years, Borand's C and C++ compilers > could output Assembler source. One could conceivably take that output and > translate it into almost any foreign CPU's native Assembler with great > efficiency I would think. That is pretty much how NestedVM works. You compile whatever language code you want with gcc and target the MIPS processor. (MIPS is regular and simple.) NestedVM then translates the MIPS object code into Java bytecode. > Opps! Straying a long way from SQLite! Not really. There is already a Java version of SQLite built using NestedVM. The OP hasn't answered my question about why he doesn't like the NestedVM approach. The recent reimplementation of SQLite in C# shows there is interest in it being "native" for various virtual environments, but with the exception of the NestedVM approach all seem to require a lot of work just to keep up with SQLite native C source. Roger -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkqDK9IACgkQmOOfHg372QS29wCgjqjMuswg2o8oQxvAMo2ZEpVK Mj4An2qeh8R0xTUkwmBmJ7l8f5MUQBVe =6LJA -END PGP SIGNATURE- ___ 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] SQLJet - pure Java implementation of SQLite and NestedVM version
I had the impression that the NestedVM version worked under Linux only, is this incorrect? g -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Roger Binns Sent: Wednesday, August 12, 2009 3:54 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLJet - pure Java implementation of SQLite -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Fred Williams wrote: > I seem to remember, haven't done it in years, Borand's C and C++ compilers > could output Assembler source. One could conceivably take that output and > translate it into almost any foreign CPU's native Assembler with great > efficiency I would think. That is pretty much how NestedVM works. You compile whatever language code you want with gcc and target the MIPS processor. (MIPS is regular and simple.) NestedVM then translates the MIPS object code into Java bytecode. > Opps! Straying a long way from SQLite! Not really. There is already a Java version of SQLite built using NestedVM. The OP hasn't answered my question about why he doesn't like the NestedVM approach. The recent reimplementation of SQLite in C# shows there is interest in it being "native" for various virtual environments, but with the exception of the NestedVM approach all seem to require a lot of work just to keep up with SQLite native C source. Roger -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkqDK9IACgkQmOOfHg372QS29wCgjqjMuswg2o8oQxvAMo2ZEpVK Mj4An2qeh8R0xTUkwmBmJ7l8f5MUQBVe =6LJA -END PGP SIGNATURE- ___ 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] Memory leak with sqlite3_exec on qnx 6.4.1
I took only a quick look, but it seems to me that sqlite3_free is only being called if there is an error. See http://sqlite.org/c3ref/exec.html g -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Greg Morehead Sent: Friday, June 26, 2009 2:49 PM To: sqlite-users@sqlite.org Subject: [sqlite] Memory leak with sqlite3_exec on qnx 6.4.1 The extremely simple app below leaks. What am I doing wrong?? Please help. #include #include #include "stdio.h" #include "sqlite3.h" #include #define TFQ_SQL_DB_NAME "/powerblock/datalog/TFQ-test.db" #define _TABLE_NAME "sqltest" int main(int argc, char *argv[]) { char sql[1024]; char * errmsg; sqlite3* db_; int flags = SQLITE_OPEN_FULLMUTEX | SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE; if (sqlite3_open_v2(TFQ_SQL_DB_NAME , _ , flags , NULL) != SQLITE_OK) { return EXIT_FAILURE; } sprintf(sql, "CREATE TABLE %s_info (col_idx, col_name, data_type, meta_type, description, grouping); " , _TABLE_NAME); int retval = sqlite3_exec(db_, sql, 0, 0, ); int idx = 1; while(retval==SQLITE_OK) { sprintf(sql, "INSERT INTO %s_info VALUES(%d, \"rowid\", \"INTEGER\", \"%s\", \"Unique Row ID\", \"_SQL\");" , _TABLE_NAME, idx++, "INTEGER" ); retval = sqlite3_exec(db_, sql, 0, 0, ); if(retval != SQLITE_OK) { printf("Recieved an sqlite failure. : Failed msg: %s", errmsg); sqlite3_free(errmsg); } else printf("Successfully inserted row idx %d\r\n", idx); usleep(5); } return EXIT_SUCCESS; } ___ 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] How to exit from sqlite shell?
Yes, and Control-Z exits sqlite3, in Windows, as expected. g -Original Message- From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Pavel Ivanov Sent: Monday, May 04, 2009 2:01 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] How to exit from sqlite shell? In windows shell Control-Z should be equivalent of Control-D on Unix (it sends EOF to stdin). Pavel On Mon, May 4, 2009 at 2:58 PM, Kees Nuytwrote: > On Mon, 4 May 2009 14:00:45 -0400, "D. Richard Hipp" > wrote: > >> >>On May 4, 2009, at 1:44 PM, Sam Carleton wrote: >> >>> prefix with a period: >>> >>> .exit >> >>Yes. Also ".quit" or ".q" or Control-D (on most Unix systems >> - I don't know if Control-D works on windows) > > Control-D doesn't work in sqlite3.exe on windows, Control-C > does, both in the windows shell (CMD.EXE) and in msys > (mingw32) bash. > -- > ( Kees Nuyt > ) > c[_] > ___ > 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] export table to csv
You can only use one command in the command-line. Use options for the others, like this: Sqlite3.exe -csv -separator ',' ioimport.db3 "select * from iotemplate;" >thisisit.csv -Original Message- From: Richard Nero [mailto:rich...@rlnero.com] Sent: Monday, March 30, 2009 10:12 AM To: sqlite-users@sqlite.org Subject: [sqlite] export table to csv All, I can successfully import a databese via command line with: sqlite3.exe -separator , ioimport.db3 ".import Temp.csv iofromexcel" Now i am trying to export a table in the db with: sqlite3.exe ioimport.db3 .mode csv .separator , .output thisisit.csv "select * from iotemplate;" .output stdout This does not work and I have tried all solutions possible. Can someone lead me in the right direction on how to do this via command line Thanks in advance! ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Are there distillate posts in the sqlite3 board?
Are you looking perhaps for digest mode? Yes, there is a digest mode for the SQLite email lists, it's one of the options you can set up. Or are you thinking of posts that were made under the influence of distillates? :) g -Original Message- From: liubin liu [mailto:7101...@sina.com] Sent: Friday, March 06, 2009 2:39 AM To: sqlite-users@sqlite.org Subject: [sqlite] Are there distillate posts in the sqlite3 board? are there any distillate posts in the sqlite3 board ? -- View this message in context: http://www.nabble.com/Are-there-distillate-posts-in-the-sqlite3-board--t p22368215p22368215.html Sent from the SQLite mailing list archive at Nabble.com. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Performance impact for heavy accessing the database file
How heavy? How many kg? :) http://www.sqlite.org/faq.html#q5 If it's all reads, you're fine, but if anyone is writing, all others are blocked until that transaction is finished. Locks are at database, not record or table level. g -Original Message- From: Eversogood [mailto:eversog...@gmail.com] Sent: Monday, March 02, 2009 9:25 PM To: sqlite-users@sqlite.org; sqlite-...@sqlite.org Subject: [sqlite] Performance impact for heavy accessing the database file Hi, How is the SQLite performance when a lot number of concurrent users access the database file? Thanks, Ev ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] drop table question ?
You may not have a column name; it might be a calculated column; for example, count(*) g -Original Message- From: John Machin [mailto:sjmac...@lexicon.net] Sent: Tuesday, February 03, 2009 2:05 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] drop table question ? On 4/02/2009 12:37 AM, Brad Stiles wrote: >>> For my own edification, why the "order by 1" clause? >> To sort them in ascending order of table name, which might make >> old-fashioned capers like visual scrutiny a little easier. > > OK then, why would one not use the column name? Maybe because one is an obscurantist sometimes :-) ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] request to become co-maintainer of DBD::SQLite
My only suggestion at the moment, please use the amalgamation instead of individual files. This makes it much easier to upgrade when SQLite releases a new version. g -Original Message- From: Clark Christensen [mailto:cdcmi...@yahoo.com] Sent: Wednesday, January 14, 2009 10:19 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] request to become co-maintainer of DBD::SQLite > One of my first code changes will be to require DBI 1.607+ The current DBD-SQLite works fine under older versions of DBI. So unless there's a compelling reason to do it, I would prefer you not make what seems like an arbitrary requirement. Otherwise, it sounds like a good start. Matt must be really busy with other work. I'll be happy to contribute where I can, but no C-fu here, either :-( -Clark - Original Message From: Darren DuncanTo: m...@sergeant.org; mserge...@cpan.org Cc: General Discussion of SQLite Database ; DBI Dev ; DBIx::Class user and developer list ; rose-db-obj...@googlegroups.com; modu...@perl.org; c...@audreyt.org Sent: Tuesday, January 13, 2009 7:55:30 PM Subject: [sqlite] request to become co-maintainer of DBD::SQLite Hello Matt Sergeant, I would like to request your permission or blessing to become an official co-maintainer of the DBD::SQLite module, which is the defacto standard binding for SQLite to Perl. (Also CC'd are some other concerned parties as FYI; my apologies if I've written too many people. But this message is initially just for response by Matt, though others can write if they feel inclined, but try to keep the recipient list smaller than I just did here. Focus any discussion to dbi-...@perl.org and modu...@perl.org as appropriate please, the former for what work needs doing and the latter for matters of module maintainership.) P.S. Or if anyone else has the tuits and wants to make a better offer to be a co-maintainer now, please do so. I am interested in the long-term success of SQLite in combination with Perl, and in the short term I am particularly interested in using the latest SQLite 3.6.8 (which adds the extremely important feature of nested transactions) with modern versions of Perl, and I am interested that it would be easy for the large number of other DBD::SQLite users to use this combination as well. I am also concerned with there apparently being a number of significant bugs in DBD::SQLite that have been reported on the RT system, some with patches, and DBD::SQLite hasn't seen new releases in awhile to either address bugs or update the bundled SQLite. A number of people I trust are seeing that this is a serious matter to address, some in the mean-time recommending use of older DBD::SQLite versions, which is itself a problem since automatic CPAN install tools would select the newest versions, and access to newer SQLite library features is missing. Now I would of course be happiest if you had the time and motivation to bring your project up to date and address its bugs. But otherwise I would like to offer you an out, and take on this responsibility myself, either alone or with partners such as yourself or other concerned parties that want to help. If you agree, then please say the word to modu...@perl.org. My CPAN account ID is DUNCAND. To summarize, this is my intention in the short term: 1. Release a new version every time there is a SQLite core library release. 2. Make only the most minimal changes to DBD::SQLite itself, to ensure that reported bugs are fixed and that it compiles on modern systems and passes its own test suite on the same. There won't be any feature additions or architectural changes initially, except where such may be highly demanded and simple. The priorities here are stability and correctness plus easy access to all the SQLite library's native features, and minimal additional features. 3. All initial releases will have version numbers ending in _NN that mark them as developer releases, so the community can test them before they become what the CPAN tools install by default. 4. Perhaps follow what Audrey Tang started and use the official amalgamated pre-compiled source files rather than the original-original source code, so users with less capable build environments can handle it. Though in the short term this will depend on which version I can get to work with fewer problems on my own machine (Mac OS X Leopard). 5. I may use an older DBD::SQLite than the current one, such as 1.12, as an initial point of departure, if doing so makes for a more trouble-free solution. 6. I will have this in a public GIT source repository and I will regularly seek feedback, help, patches, testing, etc from the user community that have a stake in this working. 7. I am assuming until corrected that the primary discussion forum for people to discuss actual work to do and patches
Re: [sqlite] SQLite version 3.6.8
Yes, the amalgamation driver is the better way to do this. It has been working for me, for several SQLite updates. g -Original Message- From: Jim Dodgen [mailto:j...@dodgen.us] Sent: Monday, January 12, 2009 10:42 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] SQLite version 3.6.8 I am having better luck with the amalgamation that has been created by Audrey Tang. My production is still on 3.4 and testing on 3.6 with the amalgamation has been promising On Mon, Jan 12, 2009 at 8:14 PM, Darren Duncanwrote: > Jim Dodgen wrote: > > Please post back with success/failure of the Perl bindings. > > Yes, about that ... it seems the bindings have gotten stale and have some > outstanding issues ... I'm hoping that someone will step up and maintain > them > ... I currently lack the C experience to do it easily myself if any such > maintenance is needed, except on an experimental basis ... I'll also try > contacting the most recent maintainers about it. -- Darren Duncan > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- Jim Dodgen j...@dodgen.us ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Hi, a question from Colombia
Brazil, but living in the Chicago area of the USA since 1991. -Original Message- From: MikeW [mailto:mw_p...@yahoo.co.uk] Sent: Monday, January 12, 2009 6:35 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Hi, a question from Colombia Ribeiro, Glauber <glauber.ribe...@...> writes: > > Carlos, > > If you don't mind, I'll answer through the list, because there are > people there who know much more than I do. > > > glauber > Hey, glauber, you didn't say which country you were from ! ;-) MikeW (UK) ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Hi, a question from Colombia
Carlos, If you don't mind, I'll answer through the list, because there are people there who know much more than I do. Here's your question: > Here I'm looking for subtract two datefields from diferentes tables if > the field1 is not null, if that field is null the value is 'without > close' and this case conditional > > CASE >WHEN field1 IS NULL > THEN 'SIN CERRAR' > ELSE (STRFTIME('%J',field1) - STRFTIME('%J',field2)) > END AS DIAS_CERRAR, How are you storing your dates? SQLite doesn't have a true date format, so you need to store it either as a string or a number (which could be a Julian date, a Unix-style number of seconds since a reference date, or something else even). Assuming you are storing your dates as strings like this: 2009-01-09, the code above should give the difference, in days, between the 2 dates. Is it not working for you? > and this > > convert(STRFTIME('%J',field1) - STRFTIME('%J',field2)) I'm not sure what this is; convert() is not a standard function in SQLite. Is this from hsql? Or is it a user-defined function? glauber -Original Message- From: Carlos Suarez [mailto:carlos.sua...@rolsoft.com] Sent: Friday, January 09, 2009 1:14 PM To: sqlite-users@sqlite.org Subject: [sqlite] Hi, a question from Colombia Hi, my name is Carlos Suarez from Colombia, I have a few problems while I migrated from hsql to sqlite and I want to know if you can help me with some of this stuff by this way of mail or have I to quote in somewhere?. thanksfully Carlos Suarez ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Hi, a question from Colombia
Hi, Carlos, People here are helpful and friendly, and we will try to help you in our abundant free time, but try to include as much information as possible with your question, so we can give you meaningful answers. For example, don't just ask "why is my SQL so slow?", but tell us specifically what SQL you are running, number or records in your table, kind of computer, anything that might help us figure it out. glauber -Original Message- From: Carlos Suarez [mailto:carlos.sua...@rolsoft.com] Sent: Friday, January 09, 2009 1:14 PM To: sqlite-users@sqlite.org Subject: [sqlite] Hi, a question from Colombia Hi, my name is Carlos Suarez from Colombia, I have a few problems while I migrated from hsql to sqlite and I want to know if you can help me with some of this stuff by this way of mail or have I to quote in somewhere?. thanksfully Carlos Suarez ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] "meta command" via string via shell?
You didn't mention which OS you're in. This works in Unix: $ sqlite3 -help Usage: sqlite3 [OPTIONS] FILENAME [SQL] FILENAME is the name of an SQLite database. A new database is created if the file does not previously exist. OPTIONS include: -init filename read/process named file -echoprint commands before execution -[no]header turn headers on or off -bailstop after hitting an error -interactive force interactive I/O -batch force batch I/O -column set output mode to 'column' -csv set output mode to 'csv' -htmlset output mode to HTML -lineset output mode to 'line' -listset output mode to 'list' -separator 'x' set output field separator (|) -nullvalue 'text'set text string for NULL values -version show SQLite version $ sqlite3 -list -separator " " test.sqlite "select * from a;" 1 one 2 two 3 three I had a tab character inside the quotes after -separator g -Original Message- From: Webb Sprague [mailto:webb.spra...@gmail.com] Sent: Monday, January 05, 2009 12:45 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] "meta command" via string via shell? > If I understand correctly, all you need to do is write the desired > commands out to a text file, then either direct stdin to the text file, > or use the '.read" command. Yes, I could write the commands out to a file (ick!), but I don't really want to add four lines and a whole lot of I/O. I could also use a "here document", but again, I was kind of hoping to do it all in one string from the command line. It is a common enough operation that I am going to hold out for an answer to my original question. Thanks though! ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Creating Histogram fast and efficiently :)
If the data were small I'd do a case statement, otherwise, create a table with the ranges and join that to your main table. g -Original Message- From: Jonathon [mailto:thejunk...@gmail.com] Sent: Wednesday, December 31, 2008 5:16 AM To: General Discussion of SQLite Database Subject: [sqlite] Creating Histogram fast and efficiently :) Hello all, I have a column of numbers in a table, and I was wondering if it is possible to create a histogram out of it fast and efficiently? For example, assuming the data in the column is: 1, 5, 10, 12, 12, 15, 20, 20, 20.. I would like to return: 'less than 10' --> 2 'less than 20 and greater than or equal to 10' --> 4 'great than or equal to 20' --> 3 I hope that makes sense. I checked all over Google, and it seems that different databases seem to tackle this problem differently. So.. I was just curious how sqlite can help me make this calculation fast :) Thanks, J ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] [perl] unable to open database file
Perhaps the directory name is mispeled? Do "$!" or "$@" have anything interesting in them? Perl's debugger is invoked with the -d switch. See the "perldebug" document -Original Message- From: LUKE [mailto:l...@tc.program.com.tw] Sent: Thursday, December 18, 2008 1:31 AM To: sqlite-users@sqlite.org Subject: [sqlite] [perl] unable to open database file DBD::SQLite::st execute failed: unable to open database file(14) at dbdimp.c line 423 1. I use root to run the program. 2. I try to chmod 777 -R directory. But the error is still exist. How to debug the program? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] convert sql for sqlite 2.8.17
This should return only one record, right? So you shouldn't need the second order by ("order by f.type asc, f.price desc"). -Original Message- From: Martin Engelschalk [mailto:[EMAIL PROTECTED] Sent: Monday, December 08, 2008 8:15 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] convert sql for sqlite 2.8.17 Hi, I don't know what your problem is, exactly. However, I suspect that you have to alias the second "fruits" as well: select f.type, f.variety, f.price from fruits f where f.rowid in (select f1.rowid from fruits f1 where f1.type = f.type order by f2.price desc limit 1) order by f.type asc, f.price desc; Martin Hariyanto Handoko wrote: > I still sqlite 2.8.17. Can someone help me to convert this sql? > tx > > select f.type, f.variety, f.price > from > fruits f > where > rowid in (select rowid from fruits where type = f.type order by > price desc limit 1) > order by f.type asc, f.price desc; > ___ > 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] Missing TCL/TEA source code
I think the source code for SQLite with TCL for version 3.6.6.2 is missing from sqlite.org. Thanks, glauber ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Wondering about SQLite and Java
What is the current wisdom about the best JDBC driver to use for SQLite in Linux? Thanks, glauber ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] How does sqlite return the status of the data base
It uses OS-level file locking. Read http://sqlite.org/atomiccommit.html Here's some more: http://sqlite.org/lockingv3.html Documentation page: http://sqlite.org/docs.html g -Original Message- From: Igor Tandetnik [mailto:[EMAIL PROTECTED] Sent: Friday, November 07, 2008 2:14 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] How does sqlite return the status of the data base Rick Pritchett <[EMAIL PROTECTED]> wrote: > So how does it handle the transactions? Is it just however it > retrieves them What do you mean, "retrieves them"? Retrieves from where? > or just which notices that the DB is available? And > how does sql return the state its in to the proc? When you call sqlite3_step, and the database is locked by another connection, the call returns SQLITE_BUSY error. Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] How does sqlite return the status of the data base
It uses OS-level file locking. Read http://sqlite.org/atomiccommit.html g -Original Message- From: Igor Tandetnik [mailto:[EMAIL PROTECTED] Sent: Friday, November 07, 2008 2:14 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] How does sqlite return the status of the data base Rick Pritchett <[EMAIL PROTECTED]> wrote: > So how does it handle the transactions? Is it just however it > retrieves them What do you mean, "retrieves them"? Retrieves from where? > or just which notices that the DB is available? And > how does sql return the state its in to the proc? When you call sqlite3_step, and the database is locked by another connection, the call returns SQLITE_BUSY error. Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] How does sqlite return the status of the data base?
Do you mean "First come first serve"? In that case, I suppose not, since there is no server processed involved, to mediate access. -Original Message- From: Igor Tandetnik [mailto:[EMAIL PROTECTED] Sent: Friday, November 07, 2008 10:44 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] How does sqlite return the status of the data base? Rick Pritchett <[EMAIL PROTECTED]> wrote: > Also does sqlite use a serialized queue for > processing the > transactions? I'm not sure I understand the question. What precisely do you mean by "serialized queue"? Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] strcpy and sqlite3_column_text
Yes, this is a little irritating. Back in the time when I used to do C, I always used strncpy and then stuck a '0' at the end of the new string. -Original Message- From: Dave Dyer [mailto:[EMAIL PROTECTED] Sent: Friday, October 10, 2008 12:25 PM To: Teg; General Discussion of SQLite Database; Teg; General Discussion of SQLite Database Subject: Re: [sqlite] strcpy and sqlite3_column_text > >strcpy(result->>ip_address,(const char*)pszData); Strcpy is one of those evil "standard" c functions that no one should every use, because it copies an unlimited and unknown amount of data into an obviously finite buffer. If some joker puts a little extra data in a sqlite IP address, and you've got a bug that could take forever to find. Standard strncpy is also pretty evil, because it doesn't guarantee a null at the end. I know you're all too smart to be so sloppy, and this little lecture is totally redundant and unnecessary. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Memory Resident Database
You probably want to open your in-file database, open the :memory: database, and copy all the data from the file to memory, do your manipulations in memory, then copy back to file when you're done. http://www.sqlite.org/cvstrac/wiki?p=InMemoryDatabase has a simple TCL program to copy a database, which you could adapt to C# If this database is read-only, maybe pragma journal_mode = off would get you enough performance? -Original Message- From: Mihai Limbasan [mailto:[EMAIL PROTECTED] Sent: Monday, October 06, 2008 1:10 AM To: General Discussion of SQLite Database Subject: Re: [sqlite] Memory Resident Database marcglennjamon wrote: > Hello guys, > > Is there an option in SQLite to make the database file reside in the > memory during sql transactions for faster access? > I am using the C# language under Mono. > > Thanks in advance, > Marc Glenn > Yes - use ":memory:" (without the double quotes) as the database name when opening it. Be aware, though, that all tables and their contents will disappear once you close the database connection. HTH, Mihai Limbasan ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Can't insert timestamp field with value CURRENT_TIME
You can probably do it the hard way: create a new table with the structure you need, then populate it with data from your old table, then rename both tables. -Original Message- From: Dan [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 30, 2008 11:53 PM To: General Discussion of SQLite Database Subject: Re: [sqlite] Can't insert timestamp field with value CURRENT_TIME On Sep 27, 2008, at 7:13 AM, Mark Wyszomierski wrote: > Hi, > > I'm trying to add a timestamp field to an existing table using the > following > statement: > >ALTER TABLE test ADD COLUMN lunchtime TIMESTAMP NOT NULL DEFAULT > CURRENT_TIME > > this fails with the following error: > >Cannot add a column with non-constant default > > Ok that makes sense - but why can we CREATE a table with a timestamp > field > whose default is CURRENT_TIME, but not alter one with that as the > default > value? I may be misusing the syntax - SQLite doesn't modify the underlying table structure when you add a column using ALTER TABLE. So after the ALTER TABLE is executed, the existing rows now contain one value less than the table has columns. When SQLite reads the table, it detects the short row and returns the default column value in place of any missing values. This wouldn't work with something like CURRENT_TIME. > Thanks, > Mark > ___ > 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] Does sqlite caches data to speed up transaction
SQLite needs to guarantee transaction integrity and concurrent accesses (more than one process could be writing and reading a SQLite database at the same time). It has to go to greath lengths to ensure that the data actually gets written to disk instead of staying in memory cache. All this has overhead. If your application doesn't require these extra features, then the flat-file approach you describe may work better for you. g -Original Message- From: Robert Simpson [mailto:[EMAIL PROTECTED] Sent: Monday, September 29, 2008 3:30 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Does sqlite caches data to speed up transaction This isn't unexpected at all. The overhead of using a database (even SQLite) is much much higher than seeking to an area of an open file and reading some bytes out of it. From: devesh tiwari <[EMAIL PROTECTED]> Sent: Monday, September 29, 2008 12:15 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Does sqlite caches data to speed up transaction I am not seeing this performance difference in write but in reading database. Following is the sequence i am performing for reading: 1. sqlite3_open() 2. sqlite3_prepare() 3. sqlite3_bind_int() 4. sqlite3_step() 5. sqlite3_column() 6. sqlite3_finalize() 7. sqlite3_close() steps 1 , 2,6& 7 are done only once and i am also doing sqlite_reset() before i use sqlite3_bind_int() again to create a query. the query is always of the form: select column from table where index='index_no'; so i need to change table name and index_no only for the next query. If i dont use sqlite than sequence of reading is: 1) open file 2) seek in the file(seek value is simply calculated as index*size_of_structure) 3) read 4)close file In this case file is opened once and only steps 2 & 3 need to perform for reading data and this is 10 times faster than sqlite. Thanks & Regards Devesh Kumar Tewari --- On Mon, 9/29/08, [EMAIL PROTECTED] wrote: > From: [EMAIL PROTECTED] > Subject: sqlite-users Digest, Vol 9, Issue 88 > To: sqlite-users@sqlite.org > Date: Monday, September 29, 2008, 9:30 PM > Send sqlite-users mailing list submissions to > sqlite-users@sqlite.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > or, via email, send a message with subject or body > 'help' to > [EMAIL PROTECTED] > > You can reach the person managing the list at > [EMAIL PROTECTED] > > When replying, please edit your Subject line so it is more > specific > than "Re: Contents of sqlite-users digest..." > > > Today's Topics: > > 1. Re: Duplicated primary key error (Mariano Martinez > Peck) > 2. Re: Duplicated primary key error (P Kishor) > 3. Re: Duplicated primary key error (Mariano Martinez > Peck) > 4. Does sqlite caches data to speed up transaction time? > (devesh tiwari) > 5. Re: Does sqlite caches data to speed up transaction > time? > (Jay A. Kreibich) > 6. Re: Duplicated primary key error (Dennis Cote) > > > -- > > Message: 1 > Date: Sun, 28 Sep 2008 21:03:39 -0300 > From: "Mariano Martinez Peck" > > Subject: Re: [sqlite] Duplicated primary key error > To: sqlite-users@sqlite.org > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > Please I need help with this :( > > I am getting BUSY or IOERR_BLOCKED when inserting a > duplicated pk through C > interface. > > If I do it through sqlite.exe I get: SQL error: PRIMARY KEY > must be unique > > Any ideas? > > many thanks, > > mariano > > > > On Sun, Sep 21, 2008 at 9:05 PM, Mariano Martinez Peck < > [EMAIL PROTECTED]> wrote: > > > Hi everybody! > > > > This is my first post in this list! I am very newbie > with Sqlite. This is > > the first time I am trying to use it. I am using > Sqlite3 trough C interface. > > The problem I have is this: I have a table created, > just like this: > > > > CREATE TABLE materia( > > codigo INTEGER PRIMARY KEY, > > nombre CHARACTER VARYING(50), > > observaciones CHARACTER VARYING(255), > > ) > > > > Then I do 2 inserts one after the other, with the same > data. For example: > > > > INSERT INTO materia(codigo, nombre, observaciones) > VALUES (55, ''TADP'', > > ''Nothing") > > > > After doing this, I thought the second query ( i am > using sqlite3_step() > > function ) will returns me a > SQLITE_ERROR. > > However, it SQLITE_IOERR_BLOCKED. > > > > Is this correct? what should sqlite3_step returns me > in this case? > > > > Many thanks for the help, > > > > Mariano > > . > > > > > > > -- > > Message: 2 > Date: Sun, 28 Sep 2008 19:15:47 -0500 > From: "P Kishor" > Subject: Re: [sqlite] Duplicated primary key error > To: "General Discussion of SQLite Database" > > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > On 9/28/08, Mariano Martinez Peck > wrote: > > Please I need help with this :( > > > > I am getting BUSY or
[sqlite] What happened to .bail?
The documentation for sqlite3 on the web site: http://www.sqlite.org/sqlite.html Lists a .bail (on|off) command (stop after hitting an error. Default off) This doesn't seem to be implemented in the current version. Why? This seems to be an important feature for creating robust applications. Is there any other way to get this behavior? Thanks, glauber -- Glauber Ribeiro Information Security and Infrastructure Experian Automotive -- Schaumburg, IL ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Core dumps on AIX with optimization
This issue continues with version 3.6.2 g -Original Message- From: Ribeiro, Glauber Sent: Friday, September 19, 2008 11:55 AM To: General Discussion of SQLite Database Subject: [sqlite] Core dumps on AIX with optimization Just wondering, are there other AIX Sqlite users out there, and what have you done in order to get a successful compile? I found out that on our AIX 5.2, with IBM's Visual Age C v9.0, the command line utility sqlite2 dumps core when running SQL that contains an aggregation function, if it was compiled with any level of optimization. It seems to work fine if C optimization is turned off. I reported this at http://www.sqlite.org/cvstrac/tktview?tn=3344,2 (ticket 3344), and at least one more person reported seeing the same problem. I'm not worried about the lack of optimization, just thinking that this may be caused by an underlying problem in the C code. Thanks, glauber ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Core dumps on AIX with optimization
Just wondering, are there other AIX Sqlite users out there, and what have you done in order to get a successful compile? I found out that on our AIX 5.2, with IBM's Visual Age C v9.0, the command line utility sqlite2 dumps core when running SQL that contains an aggregation function, if it was compiled with any level of optimization. It seems to work fine if C optimization is turned off. I reported this at http://www.sqlite.org/cvstrac/tktview?tn=3344,2 (ticket 3344), and at least one more person reported seeing the same problem. I'm not worried about the lack of optimization, just thinking that this may be caused by an underlying problem in the C code. Thanks, glauber ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] best language match for SQLite?
SQLite is written in C, and its creators seem to be fond of TCL, so those are 2 good choices, but I don't think there is a most ideal language for anything - it all depends on balancing what you need to do and what you want to learn. And of course, Perl is always best. :) g -Original Message- From: Patrick [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 16, 2008 10:51 AM To: General Discussion of SQLite Database Subject: [sqlite] best language match for SQLite? I am a beginner to intermediate Python Programmer. I can use SQLite with it just fine but it is my understanding that relational database and object oriented programming our not the perfect marriage. I was just wondering if anyone had an opinion on the most ideal language to use with SQLite? I love Python but I LOVE SQLite, I would learn another language just to use it better-Patrick ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Dates & SQLite
True, but it seems to me that "Julian dates" (floating-point numbers) in Universal Time are the least cumbersome way to go if you want a binary representation, or character strings in one of the supported formats, if you want a human-readable one. You can also use Unix timestamps (integers), but those are slightly more cumbersome, because they require an aditional keyword ('unixepoch') to process. g -Original Message- From: Igor Tandetnik [mailto:[EMAIL PROTECTED] Sent: Monday, September 15, 2008 11:23 AM To: sqlite-users@sqlite.org Subject: Re: [sqlite] Dates & SQLite Brown, Daniel <[EMAIL PROTECTED]> wrote: > Could someone point me to the documentation regarding dates and > SQLite? http://sqlite.org/lang_datefunc.html > I'm having trouble finding anything about what data type I > should use to store dates in my SQLite tables, should it be a > numerical type (integer or real) or a string? Your choice. SQLite doesn't have a dedicated date type, but it provides built-in functions that can handle a variety of representations. You can choose which one to standardize on. Igor Tandetnik ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] Question about vacuum
Hello, Here's another newbie question, but it doesn't look like the documentation for vacuum covers this. I'm using SQLite to store an application's log. Suppose I have a program that runs nightly and deletes log records that are older than 60 days, to keep the database from growing without boundaries. I understand that deleting the records doesn't shrink the database file, unless I also vacuum. However, will SQLite re-use the space taken by the deleted records to store new ones? (Would I be better off not doing vacuum, and letting SQLite reuse the disk space instead?) I believe this is the case with PostgreSQL. Thanks, glauber ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] SQLite test suite - where is it?
Sorry for the newbie question, but how is the regression testing invoked? I tried "make check" with the 3.6.2 "amalgamation" distribution in Unix, but that seemed to do nothing. Thanks, glauber ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users