[sqlite] Is this behavior expected?

2017-09-24 Thread Baruch Burstein
SQLite version 3.20.1 2017-08-24 16:21:36 sqlite> create table T(C); sqlite> insert into T values("test 1"); sqlite> select last_insert_rowid(); 1 sqlite> begin; sqlite> insert into T values("test 2"); sqlite> select last_insert_rowid(); 2 sqlite> rollback; sqlite> select last_insert_rowid(); 2 In

[sqlite] Fwd: SAVEPOINT name

2015-05-21 Thread Baruch Burstein
Hi, What are the restrictions (if any) on a sve point name? Alphanumeric? Same as a string (enclosed in ' ' if necessary)? Something else? Thank you, Baruch -- ?u?op-?p?sdn s? ?o??uo? ?no? 's??? p??? u?? no? ??

[sqlite] Fwd: SAVEPOINT name

2015-05-21 Thread Baruch Burstein
On Thu, May 21, 2015 at 7:15 PM, Simon Slavin wrote: > > > Also, savepoint names can't be used as parameters when binding. Does that mean that I can't prepare this: "SAVEPOINT :name"? What would be the recommended method of preventing SQL injection for this? -- ?u?op-?p?sdn s? ?o??uo? ?no? 's?

[sqlite] Does PRIMARY KEY imply NOT NULL?

2015-09-09 Thread Baruch Burstein
Question in the subject -- ?u?op-?p?sdn s? ?o??uo? ?no? 's??? p??? u?? no? ??

[sqlite] Does PRIMARY KEY imply NOT NULL?

2015-09-10 Thread Baruch Burstein
On Thu, Sep 10, 2015 at 12:04 AM, John McKown wrote: > On Wed, Sep 9, 2015 at 3:56 PM, Baruch Burstein > wrote: > > > Question in the subject > > > > -- > > > > > ?Answered on the SQLite web site: http://sqlite.org/lang_createtable.html Thank you. I

Re: [sqlite] locating a minimum in SQLite 2

2016-12-01 Thread Baruch Burstein
On Thu, Dec 1, 2016 at 9:12 PM, James Walker wrote: > Let's say I have a table INFO with columns PRICE and IDENT, and I want to > find the IDENT of the row with the minimum value of PRICE. In SQLite 3, I > can say > > SELECT MIN(PRICE), IDENT FROM INFO; > > and get what I want. But in SQLite 2

[sqlite] caching sqlite3_db_mutex()

2017-05-25 Thread Baruch Burstein
Hi, Is it safe to cache the mutex pointer returned by `sqlite3_db_mutex(sqlite3*)`? Can/does the mutex pointer change thought the life of the `sqlite3` object? Thanks, Baruch -- ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı ___ sqlite-users maili

[sqlite] Understanding transactions

2014-02-03 Thread Baruch Burstein
I am a little unclear on some of the ways transactions affect multiple connections. I am assuming that multiple sqlite3 objects in one program is the same as multiple programs. 1) How does a transaction affect SELECTs? If I start a transaction and do an UPDATE/DELETE/INSERT, what data will a SELEC

Re: [sqlite] Understanding transactions

2014-02-03 Thread Baruch Burstein
Thank you for the explanations. If I wrap a few SELECTs in a transaction, does this guarantee that the data I read will be consistent across all of the SELECTs? -- ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı ___ sqlite-users mailing list sqlite-u

Re: [sqlite] How do I know the python functions registered on SQLite ?

2014-05-11 Thread Baruch Burstein
On Thu, May 8, 2014 at 11:46 PM, Roger Binns wrote: > > SQLite could provide the information as a virtual table or similar. A > ticket was created 7 years ago asking for it, and closed 2 months ago by > the team with resolution "Rejected": > > https://www.sqlite.org/src/tktview?name=5896edbe46

[sqlite] Pre-preparing querys

2014-05-17 Thread Baruch Burstein
What is the overhead of holding open a prepared statement? If my program is not time critical at all (it is mostly UI bound), but every once in a while (anywhere from 10 times a second to once every 10 minutes) it needs to run a few querys, would it make more sense to prepare all of the querys once

[sqlite] Is sqlite case-sensitive?

2014-05-18 Thread Baruch Burstein
Sqlite is case-insensitive as far as table/column/db names. Is this documented as official behavior or it may change? Also, is there a function in the API to validate a SQL statement, either in the context of the current connection (validate also table/column/db names), or without context (just va

Re: [sqlite] Is sqlite case-sensitive?

2014-05-18 Thread Baruch Burstein
On Sun, May 18, 2014 at 5:32 PM, Baruch Burstein wrote: > Sqlite is case-insensitive as far as table/column/db names. Is this > documented as official behavior or it may change? > > Also, is there a function in the API to validate a SQL statement, either > in the context of the cur

Re: [sqlite] Is sqlite case-sensitive?

2014-05-18 Thread Baruch Burstein
On Sun, May 18, 2014 at 10:46 PM, James K. Lowden wrote: > On Sun, 18 May 2014 19:15:18 +0200 > RSmith wrote: > > > > As Igor says, http://sqlite.org/c3ref/prepare.html would be > > > appropriate. However, a database connection is required for this. > > > > But of course What kind of syntact

[sqlite] Inconsistency in API

2014-05-26 Thread Baruch Burstein
Hi, It seems to me that there is some inconsistency in the API. Some APIs that take a string have an option to pass the length in order to improve performance. Some, like sqlite3_prepare*, *include* the terminating NULL in the length, so for "abcd" the number passed would be 5. Others, like sqlite

Re: [sqlite] New DLLs and sources. Was: SQLite version 3.8.5 beta

2014-05-29 Thread Baruch Burstein
On Thu, May 29, 2014 at 3:55 AM, RSmith wrote: > > On 2014/05/28 20:26, Warren Young wrote: > >> On 5/28/2014 11:20, jose isaias cabrera wrote: >> >>> >>> I would rather have the speed >>> then the size. >>> >> >> > Rather speed than size is an Engineering decision which is easy on a > desktop/se

Re: [sqlite] New DLLs and sources. Was: SQLite version 3.8.5 beta

2014-05-29 Thread Baruch Burstein
On Wed, May 28, 2014 at 8:09 PM, Richard Hipp wrote: > On Wed, May 28, 2014 at 12:56 PM, jose isaias cabrera < > cabr...@wrc.xerox.com > > wrote: > > > > > Just noticed something... It may be nothing, but the MinGW built DLL has > > a size of 645KB while the MSVC built one has a size of 962KB.

Re: [sqlite] New DLLs and sources. Was: SQLite version 3.8.5 beta

2014-05-29 Thread Baruch Burstein
On Wed, May 28, 2014 at 9:43 PM, Richard Hipp wrote: > On Wed, May 28, 2014 at 1:20 PM, jose isaias cabrera > wrote: > > > > > 3. Is there a spot anywhere that has clear steps on creating the Sqlite3 > > DLL? > > > > http://www.sqlite.org/draft/howtocompile.html#dll > > The "draft" page above wil

[sqlite] sqlite.net (a.k.a. System.Data.SQLite) support

2014-06-22 Thread Baruch Burstein
This is not technically sqlite specific, rather .net in general, but it came up using sqlite.net, so I am asking here. If someone can point me to a general answer elsewhere, that would be great, too. I downloaded and "installed" (read: copied) the files to my project. I can create connections, comm

Re: [sqlite] SQlite on flash filesystem

2014-08-16 Thread Baruch Burstein
On Fri, Aug 15, 2014 at 10:45 AM, Levente wrote: > I am thinking about putting an SQLite database on a flash drive (SD card). > I would like to know what kind of file system is the optimal. I want to > query a lot, and insert or update a few times per minute. > Not directly related to your quest

Re: [sqlite] How do I know the python functions registered on SQLite ?

2014-08-21 Thread Baruch Burstein
On Sun, May 11, 2014 at 12:58 PM, Baruch Burstein wrote: > > On Thu, May 8, 2014 at 11:46 PM, Roger Binns > wrote: > >> >> SQLite could provide the information as a virtual table or similar. A >> ticket was created 7 years ago asking for it, and closed 2

Re: [sqlite] How to verify referential integrity of SQLite database

2012-12-22 Thread Baruch Burstein
On Fri, Dec 21, 2012 at 6:04 AM, Richard Hipp wrote: > On Thu, Dec 20, 2012 at 3:05 PM, Levi Haskell (BLOOMBERG/ 731 LEXIN) < > lhask...@bloomberg.net> wrote: > > > Tested, works perfectly. Thanks! > > > > Two questions/observation: > > > > 1. Should there be a way to determine the parent key w/o

Re: [sqlite] Is there a way to create a foreign key in existing table?

2012-12-31 Thread Baruch Burstein
On Mon, Dec 31, 2012 at 8:13 PM, Ward Willats wrote: > > On Dec 31, 2012, at 12:57 AM, Simon Slavin wrote: > > > > > On 31 Dec 2012, at 8:54am, Igor Korot wrote: > > > >> I simply forgot to do it on the table creation. And now the table has > >> many rows... > > > > You can easily modify a TABLE

[sqlite] Partial sorting

2013-04-07 Thread Baruch Burstein
If I issue a select statement with a ORDER BY clause and a LIMIT clause, does SQLite do a full sort (assuming no index) and then return the first X rows, or just a partial sort to get the first X sorted results? -- ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı ___

Re: [sqlite] Partial sorting

2013-04-07 Thread Baruch Burstein
I was thinking more of general (not just LIMIT 1) optimization: http://en.wikipedia.org/wiki/Partial_sorting On Sun, Apr 7, 2013 at 6:16 PM, Simon Slavin wrote: > > On 7 Apr 2013, at 3:51pm, Stephen Chrzanowski wrote: > > > I don't know if it'd be an interesting optimization. Who's to say what

[sqlite] System.Data.Sqlite NuGet

2013-04-11 Thread Baruch Burstein
I installed System.Data.Sqlite from via NuGet, but I don't see it in the options for creating a new database (server explorer or whatever it is called). I am using VS2010 Ultimate. Am I doing something wrong? -- ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı __

Re: [sqlite] SQLite3 extended API usage

2013-07-08 Thread Baruch Burstein
Did you update your code to sqlite*3*_get_table()? (note the '3'). On Mon, Jul 8, 2013 at 11:21 AM, techi eth wrote: > We arrive at same place were we start.I am using Sqlite3 version 3.7.9 > & by refrence from below link i can use to get tabel function but i am > getting undefined refrence erro

[sqlite] INSERT with rowid column

2013-08-06 Thread Baruch Burstein
I ran the following 2 commands: create table tests (id INTEGER PRIMARY KEY, name TEXT UNIQUE); > insert into tests values ('test 1'); > and got the following error: Error: table tests has 2 columns but 1 values were supplied > Since the id column is an alias for the rowid, shouldn't I be able t

[sqlite] Can a foreign key reference a named rowid?

2013-08-11 Thread Baruch Burstein
From the documentation for CREATE TABLE: The parent key of a foreign key constraint is not allowed to use the rowid. The parent key must used named columns only. Does this mean it can or can't use a named column that is an alias for the rowid? Is the problem using the rowid, or is the problem

Re: [sqlite] Can a foreign key reference a named rowid?

2013-08-11 Thread Baruch Burstein
On Mon, Aug 12, 2013 at 9:24 AM, Dan Kennedy wrote: > On 08/12/2013 01:20 PM, Baruch Burstein wrote: > >> From the documentation for CREATE TABLE: >> >> The parent key of a foreign key constraint is not allowed to use the >> rowid. The parent key must used

Re: [sqlite] Hints for the query planner

2013-09-11 Thread Baruch Burstein
I also think it should not be directly in the SQL. I like the not-really-a-comment syntax. Another option might be a few PRAGMAs, something like PRAGMA hint("table1.col1 IN (1,2,5)", 0.05); PRAGMA hint("table1.col2 LIKE '%bach%'". 0.4); these would add the hints to an internal table. When prepari

Re: [sqlite] Hints for the query planner

2013-10-02 Thread Baruch Burstein
On Fri, Sep 13, 2013 at 5:29 AM, Ryan Johnson wrote: > -- Join cardinality: Bach was a *very* prolific composer whose output > likely dwarfs the (surviving) output of his contemporaries > select p.title, c.name, p.year from composers c join pieces p on p.c_id = > c.id where c.name like '%bach%' an

[sqlite] Small addition to shell.c

2012-03-20 Thread Baruch Burstein
I find I was often trying to exit the shell while at the continuePrompt. This usually happens because I accidentally entered 'exit' without the period first, but sometimes for other reasons (I started to enter a SQL command and realized I didn't need to, or whatever). I have added a small fix to my

[sqlite] sqlite3 command line shell bug?

2012-03-20 Thread Baruch Burstein
I just noticed that the dot-commands are tested by the length of the input, not of the correct term. For example, '.e' will match '.exit' (it would also match '.explain', except it matches '.exit' first). Is this intended behavior? And if so, why should '.e' match '.exit' any more than '.explain'?

[sqlite] table aliases in update

2012-04-01 Thread Baruch Burstein
Does sqlite not support table aliases in update statements? Is there a way to work around this to get the affect of update table1 t1 set col1 = col1 * 2 where col1 <= (select avg(col1) from table1 where col2=t1.col2); -- Programming today is a

Re: [sqlite] 64-bit precompiled command-line shell binary for Windows 7

2012-05-01 Thread Baruch Burstein
I haven't tested it (I only have a 32-bit system), but here you go. Just change the extension to .exe On Mon, Apr 30, 2012 at 4:28 PM, Udi Karni wrote: > Dear Sqlite development team, > > I'd like to add a vote for requesting a 64-bit precompiled command-line > shell binary (sqlite3.exe) for Win

Re: [sqlite] is SQLite the right tool to analyze a 44GB file

2012-05-01 Thread Baruch Burstein
If none of your fields contain a comma, you can just use the sqlite3 terminal to load a csv file. On Tue, May 1, 2012 at 11:06 PM, peter korinis wrote: > I'm new to SQLite . not a programmer . not a DBA . just an end-user with no > dev support for a pilot project (single user, no updates, just qu

Re: [sqlite] is SQLite the right tool to analyze a 44GB file

2012-05-01 Thread Baruch Burstein
It is already wrapped in a transaction. I seem to remember seeing somewhere that the .import command doesn't understand escaping, e.g. "one","two,three" will get imported as "one" | "two | three" (the quotes are part of the data, and the second column was split into two by the comma) Ju

[sqlite] using lemon

2012-05-10 Thread Baruch Burstein
Can anyone suggest a lexical scanner generator that: a) Works well with Lemon? b) Is also thread-safe (like Lemon)? Does Flex work well with Lemon? (I think it is not thread-safe, but it is very popular and has plenty of examples around, which is also a plus for me) I am trying to learn a little

[sqlite] index creation for single-use DB

2012-05-13 Thread Baruch Burstein
I am using an in-memory DB to load data into it, do a few sort / find duplicates / SELECTs, and then dispose of the DB. It can vary in size from a few thousand rows to over a million. Would the time used for creating an index be worth it for just a single sort and a few SELECTs? If so, would it be

[sqlite] sqlite3_finalize

2012-05-14 Thread Baruch Burstein
If sqlite3_prepare_v2 didn't return SQLITE_OK, do I need to call sqlite3_finalize on the statement pointer? -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the

[sqlite] parameters

2012-05-14 Thread Baruch Burstein
Are text parameters bound with sqlite3_bind_text automatically escaped and quoted, just escaped, just quoted, or neither? -- Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots

Re: [sqlite] parameters

2012-05-14 Thread Baruch Burstein
Thank you for the quick answer. On Mon, May 14, 2012 at 4:55 PM, Richard Hipp wrote: > On Mon, May 14, 2012 at 9:49 AM, Baruch Burstein >wrote: > > > Are text parameters bound with sqlite3_bind_text automatically escaped > and > > quoted, just escaped, just quoted, or

[sqlite] a couple of questions

2012-05-14 Thread Baruch Burstein
1. Can a use the expression 'WHERE b IN (SELECT ...)' if b is a blob column? Does the 'IN' comparison work with blobs? 2. How "static" does data have to be to be bound with SQLITE_STATIC? If it won't change until the call to sqlite3_step, is that enough? How about until sqlite3_reset or sqlite3_cl

Re: [sqlite] a couple of questions

2012-05-14 Thread Baruch Burstein
On Mon, May 14, 2012 at 5:45 PM, Richard Hipp wrote: > On Mon, May 14, 2012 at 10:35 AM, Baruch Burstein >wrote: > > > > > 2. How "static" does data have to be to be bound with SQLITE_STATIC? If > it > > won't change until the call to sqli

Re: [sqlite] a couple of questions

2012-05-14 Thread Baruch Burstein
utions Operating Unit > > > > Northrop Grumman Information Systems > > > > > > From: sqlite-users-boun...@sqlite.org [sqlite-users-boun...@sqlite.org] > on behalf of Baruch Burstein [bmburst...@gmail.com] > > Sent: Monday, May 14, 20

[sqlite] proposal for api

2012-05-14 Thread Baruch Burstein
Assuming that sqlite knows how many rows are in a result set without having to sqlite3_step over each row, can there be an api like: sqlite3_in64 sqlite3_rows(sqlite3_stmt *stmt) which would run the query (if sqlite3_step has not been called on this stmt object yet), and return the number of

[sqlite] Compiler warnings with 3.7.12

2012-05-14 Thread Baruch Burstein
I just compiled the the sqlite3 shell from the 3.7.12 amalgamation download. I got the following warnings: shell.c:71:0: warning: "popen" redefined [enabled by default] In file included from shell.c:33:0: [mingw path]\bin\../lib/gcc/x86_64-w64-mingw32/4.7.0/../../../../x86_64-w64-mingw32/include/s

[sqlite] finalizing all statements before closing connection

2012-05-15 Thread Baruch Burstein
Which of the following should I be running right before calling sqlite3_close? while(stmt = sqlite3_next_stmt(db, stmt)) sqlite3_finalize(stmt); while(stmt = sqlite3_next_stmt(db, NULL)) sqlite3_finalize(stmt); I am not sure which will have the desired effect. -- Programming tod

Re: [sqlite] finalizing all statements before closing connection

2012-05-15 Thread Baruch Burstein
On Tue, May 15, 2012 at 10:34 PM, Jay A. Kreibich wrote: > On Tue, May 15, 2012 at 10:17:41PM +0300, Baruch Burstein scratched on > the wall: > > Which of the following should I be running right before calling > > sqlite3_close? > > > > while(stm

[sqlite] sqlite3_column_count vs. sqlite3_data_count

2012-05-16 Thread Baruch Burstein
sqlite3_column_count sqlite3_data_count What is the difference between the two? -- ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] NULL sqlite3_stmt in function calls

2012-05-16 Thread Baruch Burstein
Are all API functions that accept an sqlite3_stmt* safe (=NO-OPs) to call with a NULL pointer? I mean things like bind, column, etc. -- ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlit

Re: [sqlite] Escape table and column names

2012-05-16 Thread Baruch Burstein
On Wed, May 16, 2012 at 2:25 PM, Simon Slavin wrote: > > On 16 May 2012, at 11:56am, Petite Abeille > wrote: > > > On May 16, 2012, at 12:28 PM, > wrote: > > > >> Anyone have an answer? > > > > http://www.sqlite.org/lang_keywords.html > > > >> What about if table name or column name contains t

Re: [sqlite] Escape table and column names

2012-05-16 Thread Baruch Burstein
On Wed, May 16, 2012 at 2:47 PM, Jean-Christophe Deschamps wrote: > > > This FAQ topic doesn't apply here. We're talking about schema names or >> keywords, while FAQ#14 is literal escaping a single quote. >> >> create table "foo""bar" ( baz ); >> >> select * from "one""two"; >> >> select * from

Re: [sqlite] sqlite Commit C API

2012-05-20 Thread Baruch Burstein
> On Thu, May 17, 2012 at 7:04 PM, Rajesh Kumar wrote: > int fsync( int fd ) { return 0; } > > fsync will expect an Integer pointer right. But sqlite pointer is of type > sqlite3*. So how can fsync works on sqlite. What should I pass to fsync??? > > You don't need to call fsync(). Sqlite calls it

[sqlite] unicode61 FTS tokenizer

2012-06-17 Thread Baruch Burstein
Does the new FTS tokenizer `unicode61` depend on ICU? -- ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] escaping GLOB pattern

2012-06-18 Thread Baruch Burstein
Is there a built-in way to escape a GLOB pattern? Will it escape it if I bind it to a parameter in a prepared function instead of embedding it directly in the query string? -- ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı ___ sqlite-users mailing l

[sqlite] last_insert_rowid() with conflict

2012-06-19 Thread Baruch Burstein
If I have a column that has unique values, and the ON CONFLICT clause is IGNORE, is there a way to get the rowid of the last insert (on success) *or*the last conflict (on conflict). I would like to just keep adding to the table without worrying if there is a duplicate, but after each insert I need

[sqlite] foreign keys across database boundaries

2012-08-27 Thread Baruch Burstein
Can foreign keys or triggers be set between ATTACHed database tables? If so, is there any other type of statment that doesn't work across ATTACH boundaries? -- ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı ___ sqlite-users mailing list sqlite-users

Re: [sqlite] Finding rows with MIN(MTIME) for all IDs

2012-09-05 Thread Baruch Burstein
SELECT id, a, b, ..., mtime FROM tab WHERE rowid IN ( SELECT id, min(mtime) FROM tab GROUP BY id ) ORDER BY mtime DESC; On Wed, Sep 5, 2012 at 4:03 PM, Richard Hipp wrote: > > SELECT id, a, b, ..., min(mtime) > FROM tab > GROUP BY id >

Re: [sqlite] Finding rows with MIN(MTIME) for all IDs

2012-09-05 Thread Baruch Burstein
Sorry, that won't work. On Wed, Sep 5, 2012 at 4:12 PM, Baruch Burstein wrote: > SELECT id, a, b, ..., mtime > FROM tab > WHERE rowid IN ( > SELECT id, min(mtime) > > FROM tab > GROUP BY id > ) > ORDER BY mtime DESC; &

Re: [sqlite] Finding rows with MIN(MTIME) for all IDs

2012-09-05 Thread Baruch Burstein
Temporary table? Then you will have rowids. On Wed, Sep 5, 2012 at 4:16 PM, Richard Hipp wrote: > On Wed, Sep 5, 2012 at 9:12 AM, Baruch Burstein >wrote: > > > SELECT id, a, b, ..., mtime > > FROM tab > > WHERE rowid IN ( > > SELECT id

Re: [sqlite] C++ - WHERE clause

2012-09-06 Thread Baruch Burstein
VALUES is used for INSERTing into a table, not for SELECTing. This is not valid SQL (I would help you fix it, but I can't figure out what you were trying to achieve.) Here is a great reference: http://sqlite.org/lang_select.html On Thu, Sep 6, 2012 at 11:18 AM, Arbol One wrote: > As many of you

[sqlite] Read-only media

2012-09-06 Thread Baruch Burstein
Can sqlite databases be read from a read-only media? I seem to remember seeing something about this on the website, but can't find it. -- ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı ___ sqlite-users mailing list sqlite-users@sqlite.org http://sql

Re: [sqlite] Read-only media

2012-09-06 Thread Baruch Burstein
On Thu, Sep 6, 2012 at 5:26 PM, Simon Slavin wrote: > > On 6 Sep 2012, at 3:13pm, Richard Hipp wrote: > > > If the last writer to the database file crashed and left a hot > > journalthen the > > next reader to come along must rollback that jou

[sqlite] selecting real values

2012-09-11 Thread Baruch Burstein
When selecting real (float) values, does the sqlite return (and the shell display) the full precision it has by default, or does it have a higher precision stored in the database than it displays? -- ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı __

[sqlite] Unofficial poll

2012-09-23 Thread Baruch Burstein
I am curious about the usefulness of sqlite's "unique" type handling, and so would like to know if anyone has ever actually found any practical use for it/used it in some project? I am referring to the typeless handling, e.g. storing strings in integer columns etc., not to the non-truncating system

Re: [sqlite] Unofficial poll

2012-09-23 Thread Baruch Burstein
On Sun, Sep 23, 2012 at 2:23 PM, Richard Hipp wrote: > On Sun, Sep 23, 2012 at 6:37 AM, Baruch Burstein >wrote: > > > I am curious about the usefulness of sqlite's "unique" type handling, > > > SQLite is not unique in this respect. Lots of other l

[sqlite] Permalink to latest amalgamation

2012-10-24 Thread Baruch Burstein
Is there a permanent link I can use that will always point to the latest amalgamation (or .zip containing it)? I would like to automate a make script that will use the latest sqlite. I know I can use a link to the latest release in the repo, but that means I would need to build the amalgamation as

Re: [sqlite] Permalink to latest amalgamation

2012-10-24 Thread Baruch Burstein
On Thu, Oct 25, 2012 at 12:42 AM, Darren Duncan wrote: > Kees Nuyt wrote: > >> On Thu, 25 Oct 2012 00:12:16 +0200, Baruch Burstein >> wrote: >> >> Is there a permanent link I can use that will always point to the latest >>> amalgamation (or .zip containi

[sqlite] Which non-default options are used for the shell?

2012-10-25 Thread Baruch Burstein
I know FTS is enabled (SQLITE_ENABLE_FTS*), but are any other flags used in compiling the default shell? -- ˙uʍop-ǝpısdn sı ɹoʇıuoɯ ɹnoʎ 'sıɥʇ pɐǝɹ uɐɔ noʎ ɟı ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/l

Re: [sqlite] SUGGESTION: "now" as alias for "strftime('%s','now')"

2012-11-04 Thread Baruch Burstein
CURRENT_TIMESTAMP returns "-MM-DD HH:MM:SS", not a unix timestamp. I think other DB systems all use this function to return a unix timestamp. On Sun, Nov 4, 2012 at 9:34 AM, Григорий Григоренко wrote: > > > > Fri, 2 Nov 2012 14:11:26 + от "Black, Michael (IS)" < > michael.bla...@ngc.com>:

Re: [sqlite] Shell import field separators

2012-11-06 Thread Baruch Burstein
On Tue, Nov 6, 2012 at 1:40 PM, Colin Hardwick wrote: > Ladies & Gentlemen, > > My first post to this list, please be gentle! > > I'm trying to import tab-separated data, example here: > > 40009402FUNDNwL "NMF"NEAVB:GB;1 NQ NwL "NMF"NEAVB:GB;1 NQ > 10031991-02-14

Re: [sqlite] newest 3 entries

2012-11-08 Thread Baruch Burstein
On Thu, Nov 8, 2012 at 10:17 PM, Igor Tandetnik wrote: > On 11/8/2012 3:10 PM, deltagam...@gmx.net wrote: > >> I have a select statement like: >> "Select id, eventdate, eventtype, FROM eventlog WHERE eventtype in >> ('special') " >> >> Now I like to receive only the newest 3 entries in the tabl

[sqlite] using index when using concatination

2011-07-10 Thread Baruch Burstein
I am using the following SQL statement for SQLite: select * from words where "word" like ? || '%' || ? ; In order to bind parameters to the first and last letters. I have tested this both with and without an index on the column `word`, and the results are the same. However, when running the q

[sqlite] Minimize sqlite3.o size

2011-07-12 Thread Baruch Burstein
I assume this is the same for sqlite3.dll or sqlite3.lib, but if not, I am interested in sqlite3.o (mingw32). How can I minimize the size of the library (compiling with -O3, since speed is my top concern, so different optimizations is not an option)? If I know there are parts of SQL I don't need in

Re: [sqlite] Minimize sqlite3.o size

2011-07-12 Thread Baruch Burstein
Yes I know (although I only got a 200k difference), but -O3 is about twice as fast in my tests. On Tue, Jul 12, 2011 at 4:22 PM, Stephan Beal wrote: > On Tue, Jul 12, 2011 at 3:10 PM, Baruch Burstein >wrote: > > > I assume this is the same for sqlite3.dll or sqlite3.lib, but

[sqlite] Compiling sqlite

2011-07-12 Thread Baruch Burstein
The website (http://www.sqlite.org/about.html) says that sqlite can be compiled to under 300K. I am using mingw32, and with no configuration did I manage to get sqlite3.o below 400k. What compiler/compiler options are used to reach <300K? ___ sqlite-users

Re: [sqlite] Minimize sqlite3.o size

2011-07-12 Thread Baruch Burstein
ou experiment you can probably find a subset of the above that will work > for you. > > > > On Tue, Jul 12, 2011 at 9:36 AM, Baruch Burstein >wrote: > > > Yes I know (although I only got a 200k difference), but -O3 is about > twice > > as fast in my tests. > &g

Re: [sqlite] I havn't a clue

2011-07-17 Thread Baruch Burstein
Best way is to use a tool like "SQLite Database Browser" (or a similar tool). You can get it from http://portableapps.com/apps/development/sqlite_database_browser_portable or from http://sourceforge.net/projects/sqlitebrowser/files/sqlitebrowser/2.0%20beta1/sqlitebrowser_200_b1_win.zip/download. Op

Re: [sqlite] Reducing compiled size

2011-07-25 Thread Baruch Burstein
For the record, I know that the documentation says the OMIT_* flags don't work with the regular amalgamation, but I have in fact used many of them and they seem to work. Two that only partially worked (a bug?) are SQLITE_OMIT_AUTOVACUUM and SQLITE_OMIT_AUTHORIZATION (I am not sure about that second

[sqlite] SQLITE_OMIT_UTF16

2011-07-27 Thread Baruch Burstein
When I compile the amalgamation with > gcc -Os -c sqlite3.c I get a 415 KB sqlite3.o. But when I use > gcc -Os -c -DSQLITE_OMIT_UTF16 sqlite3,c I get a 409 KB file. The thing I don't understand is how can this be, because when I search sqlite3.c for "SQLITE_OMIT_UTF16", I am told it doesn't ex

Re: [sqlite] SQLITE_OMIT_UTF16

2011-07-27 Thread Baruch Burstein
It is a typo in the mail. originally it is a '.' On Wed, Jul 27, 2011 at 2:53 PM, Simon Slavin wrote: > > On 27 Jul 2011, at 12:16pm, Baruch Burstein wrote: > > > when I use > > > >> gcc -Os -c -DSQLITE_OMIT_UTF16 sqlite3,c > > Is th

[sqlite] c-api

2011-07-27 Thread Baruch Burstein
Is there an easier way to get a single value (for instance "select last_insert_rowid();" ) then prepare -> step -> column -> finalize? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQLITE_OMIT_UTF16

2011-07-28 Thread Baruch Burstein
wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 07/27/2011 04:16 AM, Baruch Burstein wrote: > > The thing I don't understand is how can this be, because when I search > > sqlite3.c for "SQLITE_OMIT_UTF16", I am told it doesn't exist

Re: [sqlite] SQLITE_OMIT_UTF16

2011-07-30 Thread Baruch Burstein
: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 07/28/2011 12:40 AM, Baruch Burstein wrote: > > On the same topic, I know the documentation says SQLITE_OMIT_* are not > > supported by the amalgamation, but I have used many of them to > successfully > > r

Re: [sqlite] SQLITE_OMIT_UTF16

2011-07-31 Thread Baruch Burstein
31 Jul 2011 09:54:29 +0300, Baruch Burstein > wrote: > > > Can you refer me to instructions on building the amalgamation? The SQLite > > website only says something like "Download the source, hand edit the make > > file, and run make". Very unhelpful as I d

Re: [sqlite] SQLITE_OMIT_UTF16

2011-07-31 Thread Baruch Burstein
On Sun, Jul 31, 2011 at 5:24 PM, Kees Nuyt wrote: > and I don't run MSWindows. > I can use Linux if it makes it easier, but I gather from the rest of your mail that you still won't be able to help me. Thank you anyway for trying. ___ sqlite-users maili

Re: [sqlite] SQLITE_OMIT_UTF16

2011-08-01 Thread Baruch Burstein
Where would I use the SQLITE_OMIT_* flags? On Sun, Jul 31, 2011 at 8:06 PM, Roger Binns wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 07/31/2011 09:14 AM, Baruch Burstein wrote: > > I can use Linux if it makes it easier, > > This is how I build which

[sqlite] Where to put the SLITE_OMIT_* options?

2011-08-02 Thread Baruch Burstein
I am trying to edit the makefile, as mentioned here http://www.sqlite.org/compile.html#omitfeatures. I am unclear as to where these options should go in the makefile, as these are not strictly compile options, as no compiling is done (the end result is a source file). Where would I put them? __

Re: [sqlite] Using Comand Lines inside a program

2011-08-07 Thread Baruch Burstein
Have a look at the shell.c file. The relevant code is at line 1655 in the latest version (in the 3.7.7.1 amalgamation .zip file). It is only about 120 lines, and most of it you could probably cut out in your own program (all the errors and processing for the command line. You can just substitute yo

[sqlite] %Q vs. %q

2011-08-08 Thread Baruch Burstein
What is the difference between > mprintf("insert into a values(%Q);", val); > and > mprintf("insert into a values('%q');", val); > If there is no difference, why have two almost identical things? ___ sqlite-users mailing list sqlite-users@sqlite.org ht

Re: [sqlite] %Q vs. %q

2011-08-08 Thread Baruch Burstein
Sorry, I meant sqlite3_mprintf On Mon, Aug 8, 2011 at 12:40 PM, Simon Slavin wrote: > > On 8 Aug 2011, at 10:35am, Baruch Burstein wrote: > > > What is the difference between > > > >> mprintf("insert into a values(%Q);", val); > > > > and

Re: [sqlite] sqlite-src-3070701.zip compilation issues

2011-08-10 Thread Baruch Burstein
Also, what command are you using to compile? On Thu, Aug 11, 2011 at 6:19 AM, wrote: > > Pls list the compilation errors.. > > --Original Message-- > From: Raja Kondu > Sender: sqlite-users-boun...@sqlite.org > To: sqlite-users@sqlite.org > ReplyTo: General Discussion of SQLite Database

Re: [sqlite] Speeding up index creation

2011-09-05 Thread Baruch Burstein
This is unrelated, but I have never done any serious testing, and am wondering what the user/sys results are in all these performance tests. Is user I/O time and sys CPU time? On Sun, Sep 4, 2011 at 11:43 AM, Filip Navara wrote: > Updated results against current trunk: > > CPU Time: user 82.00972

Re: [sqlite] Minimal library size

2011-09-11 Thread Baruch Burstein
Did you configure and make using the same options? On Sat, Sep 10, 2011 at 4:53 PM, Richard Tew wrote: > Hi, > > Is it possible to get the library size down to 180 KB on Windows using > Visual C++? I've also tried compiling for the a *nix based platform > with gcc getting similar results as I ha

[sqlite] changing compiled SQL statement

2011-09-13 Thread Baruch Burstein
If I compile a SQL statement, can I immediately change that sql string? e.g., Is this allowed: sql = sqlite3_mprintf("select a from b where c = %Q;", d); sqlite3_prepare_v2(db, sql, -1, &stmt, 0); sqlite3_step(stmt); strcpy(a, (char *)sqlite3_column_text(stmt, 0)); sqlite3_free(sql); // or s

Re: [sqlite] Minimal library size

2011-09-13 Thread Baruch Burstein
I compiled down to 255Kb, but I don't use all the OMITs, only most. I compiled with mingw, and used msys's configure. On Sun, Sep 11, 2011 at 2:31 PM, Richard Tew wrote: > On Sun, Sep 11, 2011 at 4:37 PM, Baruch Burstein > wrote: > > Did you configure and make using th

Re: [sqlite] changing compiled SQL statement

2011-09-13 Thread Baruch Burstein
If I compile a SQL statement, can I immediately change that sql string? e.g., Is this allowed: sql = sqlite3_mprintf("select a from b where c = %Q;", d); sqlite3_prepare_v2(db, sql, -1, &stmt, 0); sqlite3_step(stmt); strcpy(a, (char *)sqlite3_column_text(stmt, 0)); sqlite3_free(sql); // or s

[sqlite] OMIT_VIRTUALTABLE

2011-09-14 Thread Baruch Burstein
When using OMIT_VIRTUALTABLE, I get a warning at line 11688 (3.7.7.1 amalgamation) that sqlite3GetVTable is used but never defined. If I add #ifndef SQLITE_OMIT_VIRTUALTABLE #endif around it, I get an error at line 81609, because this function is actually used there! a) Is this a bug, and when

  1   2   >