Re: [sqlite] 5000 tables with 3000 records vs 1 table with 15000000 records

2010-08-22 Thread Drake Wilson
the same meaning? If so, that may indicate that a single table solution is more appropriate so that any subset of the records can be selected at once. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Parameters in views preparation

2010-08-26 Thread Drake Wilson
to merely be attached to the database connection rather than part of the permanent schema, you can use CREATE TEMPORARY VIEW instead. > Simon. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Why did it need about 5 hours for converting?

2010-09-05 Thread Drake Wilson
inter to get data and > insert into database, is there any faster to do this converting? It sounds like you may be running into http://sqlite.org/faq.html#q19. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlit

Re: [sqlite] Altering primary key in trigger produces incorrect last_insert_rowid() value

2010-09-06 Thread Drake Wilson
_insert_rowid()), cvalues...); END; and then probably suitable UPDATE and DELETE triggers too, presumably mechanically generated so you don't have to keep all the column names in sync manually. (This is the approach I sketched out for some multitable-inheritance ORM stuff that hasn&#x

Re: [sqlite] Are triggers the best way to store the modification time?

2010-09-08 Thread Drake Wilson
the sort of hard security you want unless you are very careful and apply other mechanisms as well; it tends to be best used where arbitrary access to an entire database is within a single domain of authority. Just something to be aware of, especially since you mention command-line SQLite u

Re: [sqlite] In memory database and locking.

2010-09-08 Thread Drake Wilson
ld just use one process with both a timer and packet reception, and then a single in-memory single-process db and db handle (or other data structures, but I presume you've found SQLite is convenient for some other reason). ---> Drake Wilson _

Re: [sqlite] reading directly from indices (was: returning smaller subset of columns: index vs trigger)

2010-09-11 Thread Drake Wilson
ed query when an index would not otherwise be used. > Max ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Automatic index detail

2010-09-15 Thread Drake Wilson
sking which columns would be used in the temporary index creation, for the purpose of creating permanent indices. This is useful as a secondary check even if one should theoretically know which columns will be used beforehand. ---> Drake Wilson __

Re: [sqlite] COUNT very slow

2010-09-24 Thread Drake Wilson
triggers to keep track of that yourself in a single-row auxiliary table instead. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Bug? "no such column" referring to a table by name, works by alias

2010-09-24 Thread Drake Wilson
Tables are not themselves sources in the strictest sense; a source references a table (and "is" the table for many purposes). http://archives.postgresql.org/pgsql-general/2000-08/msg00740.php claims that SQL92 requires this behavior. ---> Drake Wilson _

Re: [sqlite] usleep bug?

2010-09-27 Thread Drake Wilson
ed one million or more microseconds. Note that the function is both XSI and marked obsolescent. POSIX:2008 removes usleep entirely. nanosleep is the replacement, AFAIK. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://s

Re: [sqlite] DELETE with 64bit unsigned integer key

2010-09-29 Thread Drake Wilson
ider it a bug in the binding that bit 63 set becomes a sign bit rather than raising an error, I suppose. I didn't see you mention that anywhere, though. > Thank you, > Marco ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQLite is perfect for FILE based MESSAGE QUEUE?

2010-09-30 Thread Drake Wilson
ode would help with that, but it would increase the underlying complexity WRT filesystem and shared memory accesses. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQLite is perfect for FILE based MESSAGE QUEUE?

2010-09-30 Thread Drake Wilson
in some cases. > Thanks again > > Lynton ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Accented characters and ODBC

2010-10-01 Thread Drake Wilson
hoose which only at database creation time.) Similarly, make sure that you actually give it Unicode strings in the target encoding; there may be some autocorrection going on if you try to feed it Latin-1 characters, but I wouldn't rely on it. > Thanks, > Greg ---> Drake Wilson ___

Re: [sqlite] Tricky grouping query

2010-10-01 Thread Drake Wilson
SQL? Why not just do it in plain application logic? In the absence of more information, that would seem a more natural way to go about it. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Trigger conditionally causing delete

2010-10-01 Thread Drake Wilson
clause: CREATE TRIGGER auto_delete_summary AFTER DELETE ON detail FOR EACH ROW WHEN NOT EXISTS (SELECT * FROM detail WHERE key = OLD.key) BEGIN DELETE FROM summary WHERE key = OLD.key; END; ---> Drake Wilson ___ sqlite-users mailing list

Re: [sqlite] Trigger conditionally causing delete

2010-10-01 Thread Drake Wilson
T triggers, which run only once when triggered by a statement that alters multiple rows. I prefer to use the explicit form, but omitting it would change nothing. The full CREATE TRIGGER syntax is of course part of the documentation, at http://sqlite.org/lang_createtrigger.html. ---> Dra

Re: [sqlite] Delete from A what is not in B

2010-10-02 Thread Drake Wilson
ble composite equality in the subselect. > Is my data too big for SQLIte? is it really hanging or it could be taking 3 > days? Table A and (particularly) table B both have indices on those columns, right? ---> Drake Wilson ___ sqlite-user

Re: [sqlite] Delete from A what is not in B

2010-10-02 Thread Drake Wilson
ry key declaration implicitly creates a unique index, yes. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Atomic commit assumptions regarding underlying writes

2010-10-03 Thread Drake Wilson
g sectors of a hard disk or "rewriting" sectors of a flash-based device, or similar information for filesystems that don't do in-place writes. Pointers would be appreciated. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] SQLite working with C++'s iostream

2010-10-03 Thread Drake Wilson
mention, unless (in the latter case) you actually have per-block (or similar) crypto going on rather than purely streaming. (You do use seekp, but some underlying streams might not support it.) ---> Drake Wilson ___ sqlite-users mailing list s

Re: [sqlite] When do I need SQLITE_THREADSAFE?

2010-10-04 Thread Drake Wilson
concurrently regardless of any of this. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] query performance question

2010-10-05 Thread Drake Wilson
akes 16 ms total; I imagine the use of GROUP BY and EXISTS and the lack of the extra DISTINCT are the primary factors, but I haven't checked thoroughly enough to say so confidently. I'm using SQLite 3.7.2 on Debian GNU/Linux sid AMD64. ---> Drake Wilson _

Re: [sqlite] query performance question

2010-10-05 Thread Drake Wilson
Quoth Drake Wilson , on 2010-10-05 03:24:01 -0700: > > My current task is to get the number of foods that belong to each > > group and have at least one weight data related to them. > > That suggests something like: > > SELECT g.Z_PK AS "group", COUNT(f.Z_PK)

Re: [sqlite] disk IO error after windows resumes from sleep

2010-10-05 Thread Drake Wilson
o be more specific without knowing what kind of application is being developed. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Slow operation

2010-10-05 Thread Drake Wilson
orm next to it in a separate column if it's needed. The fact that you are using LIKE suggests that 'ian' and 'Ian' should be treated identically, but currently your primary key allows separate rows to exist for each of those. Also, PRIMARY KEY UNIQUE is redundant. A primary key is always unique. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Slow operation

2010-10-05 Thread Drake Wilson
? On a table with around 3k rows, it seems a little odd that it would take that long, even if updating every row tends to be expensive in general. What does your schema look like, if I might ask? Is there significant concurrent access with that giant upd

Re: [sqlite] Slow operation

2010-10-05 Thread Drake Wilson
d result in much more efficient storage and access, because you'd be using the SQLite components in a more natural way. The presence of that \t suggests that you might be storing sequences of records in those fields to start with;

Re: [sqlite] Inserting images (gif) in Blob field (with php)

2010-10-05 Thread Drake Wilson
/us2.php.net/manual/en/sqlite3stmt.bindvalue.php if you haven't already. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Confitional IF in triggers

2010-10-07 Thread Drake Wilson
multiple > conditions must be in separate triggers? Your answer is right in the docs, where the syntax diagrams at http://sqlite.org/lang_createtrigger.html will demonstrate that the body of a trigger is a sequence of UPDATE, INSERT, DELETE, and SELECT statements. There is no full procedural

Re: [sqlite] Registering a custom tokenizer per database rather than per connection

2010-10-08 Thread Drake Wilson
declaring which functions are allowed and which are not is just as much work as reregistering the tokenizer in the first place. However, it now occurs to me that it may be possible to use the fts3_tokenizer() function in a trigger, which is probably a bad thing when writing to untrusted databases. Hmm

Re: [sqlite] SELECT DISTINCT and multi-column UNIQUE constrains

2010-10-10 Thread Drake Wilson
mbol 1'), then later ('file B', 'symbol 1') and so on, and you can't trivially get the DISTINCT out of that without sorting in temporary storage. Using UNIQUE (symbol, file) instead would seem the obvious solution. Is there a reason you can't do that? > Joe

Re: [sqlite] Registering a custom tokenizer per database rather than per connection

2010-10-12 Thread Drake Wilson
Quoth Travis Orr , on 2010-10-12 08:17:38 -0700: > Drake Wilson said: > - However, it now occurs to me that it may be possible to use the > - fts3_tokenizer() function in a trigger, which is probably a bad thing > - when writing to untrusted databases. > > I suppose the only

[sqlite] Unsafe trigger functions (was: Registering a custom tokenizer per database rather than per connection)

2010-10-12 Thread Drake Wilson
sqlite.org/src/wiki?name=Bug+Reports says that posting to the list is the correct way to do this, please consider the above such a request. (I will look into a patch if I have time, though this is moderately unlikely.) Additional comments are naturally we

Re: [sqlite] raising constraint violations when using SELECT DISTINCT with multiple tables

2010-10-16 Thread Drake Wilson
fferent-unit rows, and does the insert on new-code rows. Maybe something like (again, untested): CREATE VIEW Code_Units_for_insert AS SELECT * FROM Code_Units; CREATE TRIGGER slightly_different_insert INSTEAD OF INSERT ON Code_Units FOR EACH ROW BEGIN INSERT OR IGNORE I

Re: [sqlite] Problem with aggregate query

2010-10-16 Thread Drake Wilson
Is it just a matter of a safety net, wanting to know when you're doing something that's not that well-defined? The query is semantically not very good, but there are many other kinds of meaningless queries that are valid SQL; it's not really SQLite's job to check that for

Re: [sqlite] DB access privilege problem...

2010-10-20 Thread Drake Wilson
to set characteristics of the file before doing the sqlite3_open(), you can open() or CreateFile() it or whatever beforehand. > Thanks in advance ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Foreign key on different database - possible?

2010-10-20 Thread Drake Wilson
Quoth Frank Millman , on 2010-10-20 11:47:06 +0200: > Ok, thanks. > > Is there any chance of it being considered for a future release? Search http://www.sqlite.org/cvstrac/wiki?p=SqliteWikiFaq for "foreign key". > Frank

Re: [sqlite] Collations, BLOB and index - strange output provided by EXPLAIN QUERY PLAN

2010-10-20 Thread Drake Wilson
tep (d), you're doing what? Sorting the resulting rows? How exactly would you use the index for that? ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Problem dumping a single line ot UTF8 text into a table (likely a n00b problem)

2010-10-28 Thread Drake Wilson
s that maybe I haven't set up the > database properly to accept UTF8 or UTF16 data, but I figured this was a > default in SQLite3. You have to pick one when you create the database, usually UTF-8. If you want UTF-16 use « PRAGMA encoding = 'UTF-16' » (or 'UTF-16le' o

Re: [sqlite] Question about manifest typing/data affinity

2010-11-06 Thread Drake Wilson
directly. Instead, an SQL column type is used. In fact, the column type "NONE" will be detected as NUMERIC affinity, per the rules in the documentation. I would use a blank type to declare a column of varying type; that would give the NONE affinity you

Re: [sqlite] is it really ok to allow non-aggregates in an aggregate line?

2010-11-10 Thread Drake Wilson
l of within-group ordering using ORDER BY. But is this part of the public interface, or is it an oddity that may change in future revisions? Hipp's response upthread seems to indicate the former, but I'd rather be sure. ---> Drake Wilson ___

Re: [sqlite] is it really ok to allow non-aggregates in an aggregate line?

2010-11-10 Thread Drake Wilson
ON is guaranteed to be semantically after ORDER BY processing and therefore allows controlling which row from a group is selected, if one is careful. Thanks for the corrections. >-j ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Lua-in-SQLite (was: Question about SQLite features.)

2010-11-11 Thread Drake Wilson
x27;t unsolvable, but it's a little harder than it might look. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Help with query

2010-11-14 Thread Drake Wilson
nerate a row for each > PattenID, COUNT(Offset_Y) combination? Does SELECT PatternID, COUNT(DISTINCT Offset_Y) FROM Tiles GROUP BY PatternID do what you're looking for? ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.or

Re: [sqlite] change sqlite table column type

2010-11-14 Thread Drake Wilson
#x27;t need it as much as you think. http://sqlite.org/lang_altertable.html shows that modifying existing column types in-place is not available. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Custom collating sequences and performance

2010-11-18 Thread Drake Wilson
index. Is > this in fact the case? When doing which queries? How do you propose to look up a key value in the index without using the collation function? ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Performing multiple actions on a query

2010-11-23 Thread Drake Wilson
If the condition is complicated enough and you want to save recomputing it, you can create a temporary table to hold the _rowid_ values from the original and then use WHERE _rowid_ IN (SELECT ...) from the temporary table to identify the rows to be moved. ---> Dra

Re: [sqlite] [ERROR] Failed compound query with simple expr in ORDER BY

2010-11-26 Thread Drake Wilson
tion would work without yielding surprising results. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] [ERROR] Failed compound query with simple expr in ORDER BY

2010-11-26 Thread Drake Wilson
t; SELECT ID a, Price b FROM OrderTest WHERE Price < 200 > ...> UNION > ...> SELECT ID a, Price b FROM OrderTest WHERE Price > 500 > ...> ) > ...> ORDER BY a IS 0, b; > a|b > 3|0.0 > 4|25.0 > 1|50.0 > 2|75.

Re: [sqlite] Question

2010-11-28 Thread Drake Wilson
Lite is only a database engine that is used by many applications to store different types of data. You might go search for help related to the specific handset software in use instead. ---> Drake Wilson ___ sqlite-users mailing list sqlite-user

Re: [sqlite] SQLITE transactions failing with multiple threads

2010-11-30 Thread Drake Wilson
es where it works. Aside from that, transaction state is bound to a handle; you're starting a transaction and then trying to start another one inside it. Open two handles instead. ---> Drake Wilson ___ sqlite-users mailing list sqlite-us

Re: [sqlite] SQLITE transactions failing with multiple threads

2010-11-30 Thread Drake Wilson
d to tell what exactly you're doing from the description, such as why you're doing these updates with two threads to start with, so it's hard to give good advice. Perhaps you could show some example code? Which threading mode do you mean? Serialized or multith

Re: [sqlite] Degrees of separation

2010-12-03 Thread Drake Wilson
her of those will work directly. An obvious approach would be to use two rows for any non-reflexive entry in the relation, which is a small amount of application logic. Another would be to rewrite the query to union the two directions together, then probably always insert non-reflexive entries in le

Re: [sqlite] Degrees of separation

2010-12-03 Thread Drake Wilson
Quoth Dariusz Matkowski , on 2010-12-03 18:46:20 -0500: > Phobic What? ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Accessing multiple rows at once via a select statement

2010-12-06 Thread Drake Wilson
(in this case, have each callback invocation increment the next-pointer). ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] need help on escaping the ']' character in the identifier

2010-12-07 Thread Drake Wilson
f | SQLite might change to raise errors instead of accepting the malformed | statements covered by the exceptions above. (I suspect the real answer is "don't do that", but I'm not entirely confident.) ---> Drake Wilson ___ sqlite-

Re: [sqlite] Inserting data using a compound SELECT

2010-12-12 Thread Drake Wilson
y since you mention that your interactive experience is mostly with Access. Having additional context might allow more useful suggestions beyond purely syntactic issues. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Inserting data using a compound SELECT

2010-12-12 Thread Drake Wilson
> Note the added VALUES keyword. Oh yes. D'oh! I think I accidentally hit kill-word before sending; sorry about that. (The other response about the table definitions is useful too.) ---> Drake Wilson ___ sqlite-users mailing list

Re: [sqlite] Windows performance problems associated with malloc()

2010-12-17 Thread Drake Wilson
[1] http://kobyk.wordpress.com/2007/07/20/dynamically-linking-with-msvcrtdll-using-visual-c-2005/ [2] http://msdn.microsoft.com/en-us/library/abx4dbyh.aspx ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Rollback transaction if error

2010-12-22 Thread Drake Wilson
atements and roll back, otherwise commit at the end. Don't include the begin/end in the list. Does that not work for you? > Thanks, > Tom > BareFeetWare ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://s

Re: [sqlite] Update not completely commit(ing)

2010-12-24 Thread Drake Wilson
q.html#q24 Oompa loompa bloopity blurn SQL syntax is easy to learn It might help your queries work too Like the oompa loompa oompa Oompa loompa doopity do o/` ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] create table 'unique' constraints behave unexpectedly

2010-12-26 Thread Drake Wilson
pecifiers on multiple columns are unrelated. You may specify a multi-column UNIQUE constraint by declaring it separately (and not as part of any column specification). ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http:/

Re: [sqlite] create table 'unique' constraints behave unexpectedly

2010-12-26 Thread Drake Wilson
Quoth Simon Slavin , on 2010-12-26 18:28:28 +: > ... and to do that you create an index on that tuple, and require the index > to enforce uniqueness: > > CREATE UNIQUE INDEX tab ON t (a,b) If you like. I was referring to CREATE TABLE t (a, b, UNIQUE (a, b)). ---&g

Re: [sqlite] create table 'unique' constraints behave unexpectedly

2010-12-26 Thread Drake Wilson
IGN KEY, but I don't have the resources to submit a full proposal right now...) ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] create table 'unique' constraints behave unexpectedly

2010-12-26 Thread Drake Wilson
of UNIQUE constraints. Oh, _there_ it is. So it is written explicitly, just a little bit compressed. I was foolish and didn't link the latter paragraph to the former when doing textual search. Hmm. ---> Drake Wilson ___ sqlite-users mailin

Re: [sqlite] create table 'unique' constraints behave unexpectedly

2010-12-26 Thread Drake Wilson
each has both forms, so the second paragraph implies repeating both pieces of information from the first. So there is no "different thought in between" exactly. Obviously this is easier for someone who already understands the base syntax well enough, but

Re: [sqlite] create table 'unique' constraints behave unexpectedly

2010-12-26 Thread Drake Wilson
rm that exists in the specification may > be useful for the SQLite developers, but may mean nothing to the > casual SQL user reading the SQLite documentation. Sorry, I don't quite understand here. To which term are you referring exactly? ---> Drake Wilson ___

Re: [sqlite] create table 'unique' constraints behave unexpectedly

2010-12-26 Thread Drake Wilson
ms. So it may have come from somewhere else (I don't recall reading the SQL specification personally), but the terms are certainly repeated in the SQLite doc. (I didn't start the thread either, FWIW, in case that was the specific "you"

Re: [sqlite] last_insert_rowid() question

2010-12-27 Thread Drake Wilson
e last_insert_rowid if the other thread is using the same connection (and not just the same database), which ideally you shouldn't be doing anyway. Is that the case here? ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] random() function does not keep value in subquery

2010-12-30 Thread Drake Wilson
00 16 ResultRow 4 2 0 00 17 Next1 8 0 01 18 Halt0 0 0 00 19 Goto0 3 0 00 ---> Drake Wilson

Re: [sqlite] Circular foreign keys

2011-01-03 Thread Drake Wilson
lite> insert into a (id, bx) values (110, -3); Error: foreign key constraint failed In particular, if you never create table B, subsequent operations on A may fail, but the creation succeeds and allows you to create B later. Also, dropping the tables may be awkward unless you

Re: [sqlite] Advice on breaking trigger recursion?

2011-01-07 Thread Drake Wilson
table. (The DELETE case would just be transparent and key on the row IDs, I expect, if you don't need to do anything there.) ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Select statement not returning any result

2011-01-16 Thread Drake Wilson
passing a length of VARNAM_SYMBOL_MAX instead, which I'm guessing is not 1. Pass the real length of the string (not the size of the buffer), or -1 to treat it as a NUL-terminated C string. Otherwise you're grabbing extra bogus bytes. ---> Drake Wilson ___

Re: [sqlite] Select statement not returning any result

2011-01-16 Thread Drake Wilson
the exact length in bytes, and any NUL characters within that number of bytes will be included in the string. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] WAL on a separate filesystem?

2011-01-19 Thread Drake Wilson
aution, especially if the SQLite component may later be replaced with the expectation of backwards compatibility. > Simon. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Second sqlite3_prepare_v2() call fails on iOS path-based databases

2011-02-01 Thread Drake Wilson
ways takes UTF-8 and does any filesystem-specific encoding transformations internally. (It may still be that it does it incorrectly on some platforms, in which case that may be a bug.) > -- Tito ---> Drake Wilson ___ sqlite-users mailing list s

Re: [sqlite] Optimising a bad design decision

2011-02-01 Thread Drake Wilson
get you better index usage on the name regardless of whether you change to a synthetic integer primary key. Of course you have to do the normalization the same way when writing the records to the DB in the first place. > Thanks, > Ian ---> Drake Wilson

Re: [sqlite] how to get a reliable Integer from a Real?

2011-02-02 Thread Drake Wilson
cognize exactly why their cases are different.) ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] LENGTH on a BLOB field stops at NUL byte

2011-02-06 Thread Drake Wilson
re actually _storing_ all the data? Can you verify that you can get all the bytes out in any way at all? Information about the schema in use would be helpful, in general. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Composite primary key with autoincrement

2011-02-15 Thread Drake Wilson
them null? More generally, could you show some example inserts with what behavior you expect? I suspect what you're looking for is best done some other way. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Composite primary key with autoincrement

2011-02-16 Thread Drake Wilson
t including that column, but that doesn't allow (A, B) and (A, C) to exist simultaneously. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Reason for random names for the master journal?

2011-02-25 Thread Drake Wilson
would not also be colliding on at least one database, but I'm not confident about that. I would try it and see what happens, but also be rather cautious about the design in such cases; it's hard to judge more accurately without knowing more about the appli

Re: [sqlite] adding fdopen to VFS?

2011-02-28 Thread Drake Wilson
inconvenient, you could provide your own chromium_sqlite3_openhandle(handle, ...) function which would do the conversion and call sqlite3_open behind the scenes. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] adding fdopen to VFS?

2011-02-28 Thread Drake Wilson
Quoth Roger Binns , on 2011-02-28 13:03:43 -0800: > On 02/28/2011 12:41 PM, Drake Wilson wrote: > > Back on the original topic, I would rather think a custom VFS sounds > > like the way to go; > > It is technically correct that will work. However it is a *lot* of > ma

Re: [sqlite] adding fdopen to VFS?

2011-02-28 Thread Drake Wilson
Quoth Drake Wilson , on 2011-02-28 14:44:38 -0700: > Furthermore, another approach if the name<->FD thing is the only > requirement would be to retrieve all the original VFS methods at init > time (using sqlite3_vfs_find) and only alter a few of them when > registering the ne

Re: [sqlite] Adjusting strategy for ROWIDs

2011-03-04 Thread Drake Wilson
If neither of those is true, you're probably looking at probing several times to avoid collisions, and that's not something the stock "pick a new row ID" mechanism handles AFAIK. ---> Drake Wilson ___ sqlite-users mailing list

Re: [sqlite] Adjusting strategy for ROWIDs

2011-03-04 Thread Drake Wilson
the total period is at least 2^64, that doesn't guarantee no repeated 64-bit values unless the output reflects the entire state, no? ISTR SQLite using (A)RC4. And that doesn't help between connections. ---> Drake Wilson ___ sqlite-users

Re: [sqlite] strange UB detected

2011-03-13 Thread Drake Wilson
as pblah[0]. pblah[1] is out of bounds, and depending on how the compiler allocates those vars it may wind up aliasing the db pointer. This is not an SQLite problem. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http:/

Re: [sqlite] In-memory database with persistent storage

2011-03-21 Thread Drake Wilson
you are willing to spend more memory to deal with it, some of the first things to try would be fiddling with the cache_size, synchronous, and journal_mode PRAGMAs, depending on what tradeoffs you want to make. > - paldepind ---> Drake Wilson ___ s

Re: [sqlite] Create table if not exists and insert seed data

2011-03-22 Thread Drake Wilson
BEGIN EXCLUSIVE before loading the schema in most cases. (The EXCLUSIVE may not strictly be necessary, but I find it makes things clearer.) ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] sqlite3_bind_blob CHOPS off at first NULL char

2011-04-03 Thread Drake Wilson
char._ No. I strongly suspect that's a red herring. In summary: - Make sure msg.num_bytes_in is actually set to what you want. - Make sure you're handling the lifetime of the buffer correctly; for testing purposes I'd use SQLITE_TRANSIENT rather than SQLITE_STATIC, si

Re: [sqlite] FTS snippet()

2011-04-13 Thread Drake Wilson
elevant restriction on the RHS of a MATCH. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] how to reuse a prepared statement

2011-04-22 Thread Drake Wilson
basic logic for both. The problem is the second time > around I get a SQLITE_MISUSE. > > What am I doing wrong? You probably need to sqlite3_reset the statement after stepping it. ---> Drake Wilson ___ sqlite-users mailing list sqli

Re: [sqlite] select * on empty virtual table

2011-04-29 Thread Drake Wilson
't seem like a valid thing to do. Presumably you should set the result values to indicate "no constraints used, no ordering consumed, an arbitrary high cost estimate, and an indicator for full-scan access (that will be recognized by the xFilter method)&quo

Re: [sqlite] select * on empty virtual table

2011-04-29 Thread Drake Wilson
his still fail if you use an empty string or other recognizable non-NULL sentinel string instead? ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] What this function returns?

2013-11-29 Thread Drake Wilson
truncation is actually a potential error: e.g., a row ID of 2^32 would be returned as 0 instead on a system with 32-bit int. It's the sort of thing you might not see in production for a while until it breaks everything suddenly a ways down the line.

Re: [sqlite] Why must WITHOUT ROWID tables have PRIMARY KEYs?

2014-01-23 Thread Drake Wilson
wish to say). If not, then you may actually have a primary key of the whole row, in which case I'm not sure why inventing a rowid is needed. ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Troubleshooting nested query performance issue

2014-02-03 Thread Drake Wilson
here's a subjective element.) ---> Drake Wilson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

  1   2   >