Re: [sqlite] Simple Select from IN - from a newbie.

2014-05-21 Thread Stephan Beal
ge it" otherwise fix it > now or pay forever. > If it IS a class assignment, the professor's point will almost certainly be along the lines of, "see how difficult that was? Now let's see how much easier it can be done..." (at which point he introduces normalization). -- - st

Re: [sqlite] Simple Select from IN - from a newbie.

2014-05-21 Thread Stephan Beal
gt; situation, the tables have already been defined and made by someone > else so I cannot change it. I'm a bit stuck with the way it is. > Then you're stuck with the problem you've got. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy

Re: [sqlite] Is sqlite case-sensitive?

2014-05-18 Thread Stephan Beal
now > i _think_ what you want is: http://sqlite.org/c3ref/complete.html -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, f

Re: [sqlite] trying sqlite4 but compilation error

2014-05-12 Thread Stephan Beal
s 8 -TLIBS ?= +TLIBS ?= -lm -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf ___

Re: [sqlite] trying sqlite4 but compilation error

2014-05-12 Thread Stephan Beal
inux-gcc that one works for me on Mint (Debian derivative). it fails to link pthread at the end, but that's easy enough to fix: there's a commented out line here: #THREADLIB = -lpthread THREADLIB = With that, it builds for me. (interestingly, it wants pthread even though THREADSAFE is set to 0?)

Re: [sqlite] LIKE operator and collations

2014-05-12 Thread Stephan Beal
relevant for you, but the pathname conditions sound similar to what you are trying to achieve. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of thos

Re: [sqlite] General error: 11 malformed database schema - near "'NOCASE'":

2014-05-09 Thread Stephan Beal
On Fri, May 9, 2014 at 2:09 PM, Stephan Beal <sgb...@googlemail.com> wrote: > On Fri, May 9, 2014 at 1:43 PM, Kleiner Werner <sqliteh...@web.de> wrote: > >> The PHP connection to SQLite DB (3.3.7) is made with PDO. >> > > It's not clear in the docs whether 3.3

Re: [sqlite] General error: 11 malformed database schema - near "'NOCASE'":

2014-05-09 Thread Stephan Beal
On Fri, May 9, 2014 at 1:43 PM, Kleiner Werner <sqliteh...@web.de> wrote: > The PHP connection to SQLite DB (3.3.7) is made with PDO. > It's not clear in the docs whether 3.3 has NOCASE. Perhaps it did not? 3.3 is ancient. http://www.sqlite.org/releaselog/3_3_7.html -- ----- steph

Re: [sqlite] WITHOUT ROWID option

2014-05-09 Thread Stephan Beal
On Fri, May 9, 2014 at 11:38 AM, Stephan Beal <sgb...@googlemail.com> wrote: > i don't think a WHERE is necessary to improve the efficiency. The > statement only gets prepared, not stepped, and i would not expect any > analysis of results until the first step() (but maybe i'm assu

Re: [sqlite] WITHOUT ROWID option

2014-05-09 Thread Stephan Beal
SQLite, as previously discussed, you could say "where 0" :^) i don't think a WHERE is necessary to improve the efficiency. The statement only gets prepared, not stepped, and i would not expect any analysis of results until the first step() (but maybe i'm assuming too much). -- - s

Re: [sqlite] WITHOUT ROWID option

2014-05-07 Thread Stephan Beal
owid missing return true only if the second PREPARE succeeds. } -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will

Re: [sqlite] Foreign Key errors

2014-05-06 Thread Stephan Beal
ular constraint can be identified in the error message. > > But that woudl require more memory and CPU cycles. > > That would be resources well spent. > And might even be justifiable given other recent speed improvements which offset them ;). -- - stephan beal http://wanderinghorse.n

Re: [sqlite] select 1 where 1 - 1;

2014-05-05 Thread Stephan Beal
On Mon, May 5, 2014 at 7:31 PM, Petite Abeille <petite.abei...@gmail.com>wrote: > On May 5, 2014, at 7:15 PM, Stephan Beal <sgb...@googlemail.com> wrote: > > Why expect an error? It's abstractly the same as saying WHERE 'a' = 'b’, > > I mean ‘where 1’, or ‘wh

Re: [sqlite] select 1 where 1 - 1;

2014-05-05 Thread Stephan Beal
equal to itself in some languages.) -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

Re: [sqlite] BLOBs and NULLs

2014-04-23 Thread Stephan Beal
r anything, it is a > ridiculous concept. > Until one implements a DCVS (i.e. Fossil), at which point sequential numbers become literally impossible to generate. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny'

Re: [sqlite] BLOBs and NULLs

2014-04-22 Thread Stephan Beal
all then use that, _NOT_ SQLITE_TRANSIENT, to avoid that sqlite makes a copy of the memory. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom wi

Re: [sqlite] BLOBs and NULLs

2014-04-22 Thread Stephan Beal
ant to, it just won't be platform-portable without settling on an encoding. If the goal is only performance, though, it might (without encoding) be (marginally) faster than using string-format data (be sure to use SQLITE_TRANSIENT when binding the memory, too). -- - stephan beal http://wanderingh

Re: [sqlite] SQLite for single user data manipulation

2014-04-16 Thread Stephan Beal
ive-swapping and slowness, but no less...), the 2gb limit > is in fact a 32bit limit and is self imposed by any 32 bit application See also: https://sqlite.org/limits.html -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But

Re: [sqlite] Database corruption issue

2014-04-11 Thread Stephan Beal
opening of the > database file until you do something with the database. This is to give > you the opportunity to issue PRAGMA statements that might influence the > opening process. > > Running a very simple statement like > > SELECT 1 FROM sqlite_master LIMIT 1; >

Re: [sqlite] Can sqlite access storage system directly?

2014-04-04 Thread Stephan Beal
On Fri, Apr 4, 2014 at 10:52 AM, 김병준 <bjkm1...@naver.com> wrote: > filesystem help, but there will be performance gain. ( e.g. From not > using Journaling > See: http://www.sqlite.org/pragma.html#pragma_journal_mode -- ----- stephan beal http://wanderinghorse.net/hom

Re: [sqlite] Improving Bulk Insert Speed (C/C++)

2014-04-02 Thread Stephan Beal
QLITE_TRANSIENT instead of SQLITE_STATIC with sqlite3_bind_text() to avoid that sqlite3 makes a copy of those strings. It will simply use your bytes as-is. -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only

Re: [sqlite] SQLite3_create_collation

2014-04-02 Thread Stephan Beal
olumn, would that then effectively apply the collation to non-string columns? -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect w

Re: [sqlite] Use of AUTOINCREMENT

2014-03-28 Thread Stephan Beal
definitive answer but is possibly a hint: fossil (primarily/originally authored by DRH) relies very much on the fact that record IDs (auto-incremented) have values greater than 0. Based on that, my strong assumption is that autoinc will never produce a negative value. -- - stephan beal http://

Re: [sqlite] Use of AUTOINCREMENT

2014-03-28 Thread Stephan Beal
antees. > i guess we can fix Fossil's assertion's in about ten thousand years when the record IDs roll over into negatives ;). -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of tho

Re: [sqlite] Use of AUTOINCREMENT

2014-03-28 Thread Stephan Beal
On Fri, Mar 28, 2014 at 2:17 PM, Clemens Ladisch <clem...@ladisch.de> wrote: > sqlite> select * from u; > -100 > 1 > Very interesting, thank you :). That's quite subtle. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Fr

Re: [sqlite] Embedded Javascript for User-defined Functions

2014-03-25 Thread Stephan Beal
ce rather than procedural style (as the first link does) because it makes managing the lifetimes of the statements much easier in the face of script-side exceptions. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's th

Re: [sqlite] Embedded Javascript for User-defined Functions

2014-03-25 Thread Stephan Beal
On Tue, Mar 25, 2014 at 2:29 PM, Stephan Beal <sgb...@googlemail.com> wrote: > http://spiderape.sourceforge.net/plugins/sqlite/ > PS: more to the point of your question: that first binding supported both normal and aggregate SQL-side functions implemented in JS, but the second b

Re: [sqlite] Problem compiling SQLite 3.8.4.1 with SQLITE_MAX_MMAP_SIZE=0

2014-03-14 Thread Stephan Beal
n CC, and maybe that list elides mails with CCs. -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have t

Re: [sqlite] Problem compiling SQLite 3.8.4.1 with SQLITE_MAX_MMAP_SIZE=0

2014-03-14 Thread Stephan Beal
ed > but not used [-Werror=unused-function] > SQLITE_PRIVATE int sqlite3BtreeSetMmapLimit(Btree *p, > sqlite3_int64 szMmap){ > See also this fix: http://fossil.wanderinghorse.net/repos/libfossil/index.cgi/info/a9263730f2 that's from Brad Harder, for BSD. -- - stephan beal http://w

Re: [sqlite] which of these is faster?

2014-03-13 Thread Stephan Beal
y seen omtime DATETIME -- Original unchanged date+time, or NULL ); CREATE INDEX event_i1 ON event(mtime); -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insis

[sqlite] which of these is faster?

2014-03-13 Thread Stephan Beal
Cookie|0|657|0||00| 14|TableLock|0|2897|0|event|00| 15|Goto|0|4|0||00| (the MAX variant also needs 16) :-? -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a pe

Re: [sqlite] table and view select difference in C api sqlite3_column_name result

2014-03-10 Thread Stephan Beal
t;abc" for every single column name. The remaining questions: - How are view selects handled differently than table selects? - If so, then what is the reasoning behind it? This is not explained, but it's quite possibly that way so that the implementation has some leeway in how it works.

Re: [sqlite] table and view select difference in C api sqlite3_column_name result

2014-03-10 Thread Stephan Beal
s ALWAYS UNDEFINED unless you use an "AS" clause to name it. If you do not use an "AS" clause then it is perfectly legal for sqlite3 to return anything it wants for the column names. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "

Re: [sqlite] About "speed"

2014-03-05 Thread Stephan Beal
C API and, consequently, development speed. That doesn't generally apply to script bindings (where using MySQL is also easy), but it does to the native C APIs. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guar

Re: [sqlite] Compilation problems after upgrading from v3.7.6.3 to v3.8.4

2014-03-04 Thread Stephan Beal
.aspx but what you're seeing seems to imply that __LINE__ is resolving to a function call? Weird. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect wor

Re: [sqlite] "INSERT" and "END TRANSACTION" time

2014-03-04 Thread Stephan Beal
30% faster in my 32-bit VM than on my 64-bit HW. While i cannot with 100% certainty say why that is, others have suggested (quite possibly correctly) that this is probably due to relevant parts of the VM's virtual drive container being cached within the host OS. -- - stephan beal http://wanderingho

Re: [sqlite] sqlite_compileoption_get + cte

2014-03-01 Thread Stephan Beal
on! Thanks :) > Strangely enough, starting at 1 seems to be right on my box: at 1: ENABLE_STAT3 OMIT_LOAD_EXTENSION SYSTEM_MALLOC THREADSAFE=0 at 0: ENABLE_STAT3 ENABLE_STAT3 OMIT_LOAD_EXTENSION SYSTEM_MALLOC THREADSAFE=0 note the duplicate first entry. -- - stephan beal http://w

Re: [sqlite] Recommended way to delete rows

2014-02-28 Thread Stephan Beal
te id), then do a DELETE FROM x WHERE id IN temptablename That might solve your list-length problem (can't say how performantly). -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct

Re: [sqlite] Network Storage

2014-02-24 Thread Stephan Beal
x or more) apps which use locking. So even if the locking works, it "might" (depending very much on your environment) slow down your app to a crawl. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only gua

Re: [sqlite] Question regarding guarantees of SQLITE_DETERMINISTIC

2014-02-17 Thread Stephan Beal
t to your question specifically, no the flag does not force determinism > (AFAICT), That coincides with Richard's answer (which i consider to be definitive ;). > it only allows the optimisation But it "would be cool if..." ;) -- - stephan beal http://wanderinghorse.net

Re: [sqlite] Text column: never used vs. set to empty string

2014-02-17 Thread Stephan Beal
eventually determined that the fields which got "lost" (set to null or empty values) were those which came out of the latin1-encoded MySQL db containing invalid UTF8 characters - the whole values were getting dropped upon transforming to JSON. TL;DR: double-check all encodings. -- - stephan beal

[sqlite] Question regarding guarantees of SQLITE_DETERMINISTIC

2014-02-17 Thread Stephan Beal
ice in one statement? - Can "within a single SQL statement" be interpreted as "within the lifetime of a given preparation of a given sqlite3_stmt handle" without distorting the truth too much, or is there a more complex definition involving subselects and such?

Re: [sqlite] Proposed enhancement to the sqlite3.exe command-line shell

2014-02-11 Thread Stephan Beal
wing SQL into an sqlite3 console, then save your credit card number there, it will be silently saved in your home directory where other users can potentially read it." -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's

Re: [sqlite] Proposed enhancement to the sqlite3.exe command-line shell

2014-02-10 Thread Stephan Beal
onfigured via environment variable, i'd be happy to see it in Unix, too. e.g. SQLITE3_DEFAULT_DB, if set to a non-empty string, would be the db which gets automatically opened at startup IFF 1==argc (or some similar heuristic - maybe always load it if no filename args are provided). --

Re: [sqlite] struggling with a query

2014-02-08 Thread Stephan Beal
Steps: 308 Thanks again! -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom w

Re: [sqlite] struggling with a query

2014-02-08 Thread Stephan Beal
name, -max(case when vid=origin.v1 then 1 else 0 end ) + max(case when vid=origin.v2 then 1 else 0 end) from v, origin group by name ; sqlite> .read x.sql bar|0 barz|0 baz|1 foo|-1 Thank you very much :). -- - stephan beal http://wanderinghorse.net/home/stephan/ http:

Re: [sqlite] struggling with a query

2014-02-08 Thread Stephan Beal
On Sat, Feb 8, 2014 at 11:57 AM, RSmith <rsm...@rsweb.co.za> wrote: > One way of doing it: > Many thanks to you and Kevin both! These examples give me plenty to study for today :). -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "

[sqlite] struggling with a query

2014-02-08 Thread Stephan Beal
unk) and am free to use recursive select if necessary, but my instinct says that this should be possible with joins and a CASE (for the status). Any prods in the right direction would be much appreciated, -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Fr

Re: [sqlite] CTE: possible doc error

2014-02-06 Thread Stephan Beal
led explanation! -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf ___

[sqlite] CTE: possible doc error

2014-02-06 Thread Stephan Beal
wiki_lineage ORDER BY mtime DESC; Or am i misunderstanding what the docs intend to say? -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, fr

Re: [sqlite] sqlite3_column_name() issue with views

2014-02-04 Thread Stephan Beal
;) http://www.sqlite.org/c3ref/images/sqlite370_banner.gif seems to be 404. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, fr

Re: [sqlite] Trying to understand curious SQL tracing behaviour

2014-02-03 Thread Stephan Beal
table code near the top of the linked snippet (stolen from fossil, of course, so the original SQL came from you ;). Thanks! That clarifies it! -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed by

[sqlite] Trying to understand curious SQL tracing behaviour

2014-02-03 Thread Stephan Beal
), but there's nothing magical happening there which can account for the "--" duplicates. :-? -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect

Re: [sqlite] pragmas in subselects?

2014-01-27 Thread Stephan Beal
uld be pretty easy to > expand the given example to cover almost any SQL statement (including any > PRAGMA). > > Even if you don't have a copy of the book, you can download the example > code off the product page: > i've got the book, so many thanks for that tip - i'll take

[sqlite] pragmas in subselects?

2014-01-26 Thread Stephan Beal
ear "table_info": syntax error sqlite> create view v as select pragma table_info(vfile); Error: near "(": syntax error Is this possible? -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the

Re: [sqlite] How to bind parameters to LIKE with sqlite3_bind_text?

2014-01-15 Thread Stephan Beal
the context, SQLITE_STATIC could be legally used, but only if the string in question is guaranteed to survive (_unchanged_) for the life of the statement. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only g

Re: [sqlite] Using SQLite by Jay Kreibich (2010 paperback edition)

2013-12-31 Thread Stephan Beal
The first edition of this book coves SQLite version 3.6.23.1. As this goes to press, work on SQLite version 3.7 is being finalized." -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed by

Re: [sqlite] Web application with SQLite

2013-12-29 Thread Stephan Beal
bar/baz you'll get the same thing. That page is written in C. The /timeline part of the request is intercepted by C code and the rest is ignored. http://fossil-scm.org/index.html/timeline/foo/bar/baz -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freed

Re: [sqlite] select only records with fields that BEGIN with a certain sub-string

2013-12-26 Thread Stephan Beal
ults (you don't even need to step() it). -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Freedom is sloppy. But since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom w

Re: [sqlite] Does SQLIte run under Windows CE?

2013-11-30 Thread Stephan Beal
On Fri, Nov 29, 2013 at 6:28 PM, J Trahair <j.trah...@foreversoftware.co.uk>wrote: > Does SQLIte run under Windows CE? And if so, which version should I > download? > i know that the version which was current in late 2007 ran on WinCE, but i haven't tried any newer versions. --

Re: [sqlite] Big number of tables

2013-11-29 Thread Stephan Beal
sql >> bar.sql [stephan@host:~/tmp]$ echo 'commit;' >> bar.sql [stephan@host:~/tmp]$ time sqlite3 x.db < foo.sql real 2m25.208s user 0m0.380s sys 0m0.468s [stephan@host:~/tmp]$ rm x.db [stephan@host:~/tmp]$ time sqlite3 x.db < bar.sql real 0m0.344s user 0m0.148s sys 0m0.000s B

Re: [sqlite] sqlite3_last_insert_rowid() and AUTOINCREMENT

2013-11-25 Thread Stephan Beal
sqlite> select last_insert_rowid(); 1 sqlite> select rowid from t; 1 -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf

Re: [sqlite] Simple string question

2013-11-14 Thread Stephan Beal
... > It is safer and faster to use the sqlite3_bind_text() interface. > Also useful, if you can't use the bind() interfaces for some reason, is sqlite3_mprintf(), which includes custom formatting specifiers which take care of the quoting: http://www.sqlite.org/c3ref/mprintf.html S

Re: [sqlite] If prepare failed do I have to call finalize?

2013-11-12 Thread Stephan Beal
point which bit me once: if the input SQL is empty, the statement will be NULL as well but 0 will be returned. So if the program is taking arbitrary input from users, it may need to watch out for that case (and simply do nothing). -- - stephan beal http://wanderinghorse.net/home/stephan/ http://g

Re: [sqlite] Feature request: Better support for database file moving

2013-11-11 Thread Stephan Beal
when close() is called on the handle, the FS can then free up that space. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Since tyranny's the only guaranteed byproduct of those who insist on a perfect world

Re: [sqlite] Feature request: Better support for database file moving

2013-11-11 Thread Stephan Beal
ckage). > How about telling your users that moving the data files while the app is using them is "not supported"? i would think that this goes without saying, but maybe some users need it to be explicit. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sg

Re: [sqlite] Need suggestion for database scheama

2013-11-07 Thread Stephan Beal
On Thu, Nov 7, 2013 at 12:15 PM, dd <durga.d...@gmail.com> wrote: > Thanks for pointing multimedia id, Stephan Beal. I missed it. I will > ad this to my schema. > If you're only storing the list for local use on one machine, adding the media ID is almost certainly overkill, but i

Re: [sqlite] Need suggestion for database scheama

2013-11-07 Thread Stephan Beal
orth the extra effort. Unfortunately, i have long since lost all that code (it was implemented in JS, using a SpiderMonkey binding for sqlite), so i don't have it to share with you, but the idea is simple enough that it doesn't really need a demonstration. -- - stephan beal http://wanderinghorse.n

Re: [sqlite] Which constraint is being violating??

2013-11-04 Thread Stephan Beal
/wiki/Web_SQL_Database -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Since tyranny's the only guaranteed byproduct of those who insist on a perfect world, freedom will have to do." -- Bigby Wolf ___ sqlite

Re: [sqlite] Dropping Trigger from Table

2013-11-01 Thread Stephan Beal
get MUCH better responses on this list if you will start demonstrating that you've read the available documentation, rather than showing us your hypothetical (obviously untested) SQL which in no way reflects the realities of SQL nor sqlite3. -- - stephan beal http://wanderinghorse.net/home/ste

Re: [sqlite] Dropping Trigger from Table

2013-11-01 Thread Stephan Beal
for triggers. It is possible (at least syntactically) to have the same trigger name in two databases (attached to each other) but not two _different_ triggers with the same name in the same db, as the documentation's diagrams clearly imply: http://www.sqlite.org/lang_createtrigger.html -- ----- steph

Re: [sqlite] Dropping Trigger from Table

2013-11-01 Thread Stephan Beal
On Fri, Nov 1, 2013 at 12:53 PM, techi eth <techi...@gmail.com> wrote: > DROP TRIGGER trigger_name From tbl_name = TestTbl WHERE ; > Google "drop trigger sqlite" says: http://www.sqlite.org/lang_droptrigger.html -- - stephan beal http://wanderinghorse.net/home/st

Re: [sqlite] Extra Space Required for Index ?

2013-10-30 Thread Stephan Beal
e of a trade-off between space and time, and in the general case more of one automatically implies less of the other. [1] http://www.sqlite.org/pragma.html#pragma_page_size -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Since tyranny's the only guar

Re: [sqlite] Database gets locked for other processes

2013-10-29 Thread Stephan Beal
to corrupt your database. See the bottom half of this page: http://www.sqlite.org/whentouse.html as well as any number of threads in this mailing list archives regarding this topic. -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Since tyranny's the only

Re: [sqlite] Is there a function that return an autoimcremented value?

2013-10-25 Thread Stephan Beal
d, current_rank, original_rank) > SELECT playerid, leagueid, auto_rank, auto_rank FROM t; > DROP TABLE t; > That will lead to dupe IDs on subsequent transactions, won't it? -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Since tyranny's the only guar

Re: [sqlite] sqlite and Python

2013-10-23 Thread Stephan Beal
e matter. That said, i have no idea how the python sqlite API reports errors - maybe it's throwing an exception, which causes python to abort with code 255, but i'm just speculating. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal "Since tyranny's the

Re: [sqlite] Segmentation Fault With Trigger

2013-10-11 Thread Stephan Beal
no idea what that is, but it's not part of sqlite3's sources. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Using several .commands from a Script

2013-10-10 Thread Stephan Beal
lls allow: echo -e ".separator '[||'\n.import ..." the -e enables the conventional set of backslash escapes. [stephan@host:~]$ echo -e ".separator ||\n.import foo bar" .separator || .import foo bar -- - stephan beal http://wand

Re: [sqlite] Using an sqlite db as a mutex?

2013-10-10 Thread Stephan Beal
On Sat, Sep 28, 2013 at 10:09 AM, Stephan Beal <sgb...@googlemail.com>wrote: > On Thu, Sep 26, 2013 at 5:31 PM, Dan Kennedy <danielk1...@gmail.com>wrote: > >> It does. Both open a write transaction on the database. In the\ >> parent posts case either would work. &

Re: [sqlite] COMMIT in SQLite

2013-10-08 Thread Stephan Beal
On Tue, Oct 8, 2013 at 9:58 PM, Petite Abeille <petite.abei...@gmail.com>wrote: > > On Oct 8, 2013, at 8:10 PM, Stephan Beal <sgb...@googlemail.com> wrote: > > > (link to the original post not included because the archives are only > > visible to list members): &

Re: [sqlite] COMMIT in SQLite

2013-10-08 Thread Stephan Beal
ri, Aug 16, 2013 at 7:29 PM, Richard Hipp <d...@sqlite.org> wrote: > On Fri, Aug 16, 2013 at 1:26 PM, Stephan Beal <sgb...@googlemail.com> > wrote: > >> Hi again, >> >> db.pAllStmt and db_static_prepare() - i've ported/implemented that to >> work at

[sqlite] Cost/viability of using "layered" views as filters?

2013-10-02 Thread Stephan Beal
except maybe for the core TCL repo) or is it worse? Your insights are much appreciated, -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/c

Re: [sqlite] Using an sqlite db as a mutex?

2013-09-28 Thread Stephan Beal
tigated flock() first, but it didn't occur to me that PHP supports that. i simply could have locked the PHP file being executed. The sqlite solution is in place now, so i'll leave it there. -- - stephan beal http://wanderinghorse.net/home/stephan/ h

Re: [sqlite] Using an sqlite db as a mutex?

2013-09-28 Thread Stephan Beal
oll back (no-op) sqlite transaction -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Using an sqlite db as a mutex?

2013-09-26 Thread Stephan Beal
bits after the sqlite3 BEGIN EXCLUSIVE returns? :-? -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Is this code OK?

2013-09-19 Thread Stephan Beal
3_errmsg(), which means you don't need errmsg unless you use it at another place which isn't shown here. What's the difference between and calling sqlite3_errmsg()? i'm not sure there is one, and one of the astute listers will probably see this and explain the difference (if any) to us. --

Re: [sqlite] Is this code OK?

2013-09-19 Thread Stephan Beal
xec() sets the pointer in its 5th parameter to ** NULL before returning. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] quetion on editing a sqlite database

2013-09-16 Thread Stephan Beal
lar. b) replace \ with / globally c) return the adjusted string. or some such. This can be done without touching your core app code, only the display code and related queries. (That said - i would have normalized to Unix paths in the first place because that's my primary environment ;) --

Re: [sqlite] racing with date('now') (was: Select with dates)

2013-09-15 Thread Stephan Beal
se it is, deep down inside, a C function call which uses time-dependent, system-level state. i.e. it's a perfect candidate for races. So avoid them, in the same way that nobody should ever (in C) expect (time(0) == time(0)) to match 100% of the ... time. -- - stephan beal h

Re: [sqlite] racing with date('now') (was: Select with dates)

2013-09-14 Thread Stephan Beal
gh. If the app runs for several minutes, it may very well later expect 'now' to be now. One could extend the above function to take an optional boolean parameter, and reset the cached value if passed a truthy value. -- - stephan beal http://wanderinghorse.net/home/

Re: [sqlite] Clarification of overloading built-in funcs

2013-09-12 Thread Stephan Beal
ity, typos, and top-posting) ----- stephan beal http://wanderinghorse.net On Sep 12, 2013 4:58 AM, "Keith Medcalf" <kmedc...@dessus.com> wrote: > > Richard, > > I think the confusion is between OVERRIDE and OVERLOAD, and in what cases > defining a function is an complete ov

[sqlite] Clarification of overloading built-in funcs

2013-09-11 Thread Stephan Beal
PI and thus local state), and currently overriding it, as opposed to overloading it, is what i'm aiming to do (when the time comes to port those bits, which isn't tonight). But... i won't if you guys can tell me in advance that it will fail. Happy Hacking! -- - stephan beal http://wande

Re: [sqlite] Hints for the query planner

2013-09-11 Thread Stephan Beal
seldom_true(EXPR) > > (5) usually_not_true(EXPR) > > > (6) nominal(EXPR) > (VII): prioritize() or priority() is neither negative nor positive in connotation, but i'm not 100% sure whether it's really indicative of what the op does. -- - stephan beal

Re: [sqlite] Hints for the query planner

2013-09-10 Thread Stephan Beal
Or... unlikely(expr (, prob=0.05)) ==> likelihood (...) (sent from a mobile device - please excuse brevity, typos, and top-posting) ----- stephan beal http://wanderinghorse.net On Sep 11, 2013 12:51 AM, "Stephan Beal" <sgb...@googlemail.com> wrote: > Plus an o

Re: [sqlite] Hints for the query planner

2013-09-10 Thread Stephan Beal
Plus an overload: unlikely(expr) ==> likelihood (expr, 0.05) (sent from a mobile device - please excuse brevity, typos, and top-posting) ----- stephan beal http://wanderinghorse.net On Sep 10, 2013 11:49 PM, "Tim Streater" <t...@clothears.org.uk> wrote: > On 10 Sep 2013 at

[sqlite] Calculating relative space used by tables

2013-09-07 Thread Stephan Beal
.backlink 98559 d.tag 340074 d.ticketchng 443123 d.plink 688172 d.delta 1241733 d.mlink 1429201 d.tagxref 1585698 d.ticket 2283276 d.event 47098047 d.blob from there calculating the relative sizes (i'm not interested in absolute sizes) is just one more step. -- - stephan beal http://wand

Re: [sqlite] Table name length in sqlite affects performance. Why?

2013-09-06 Thread Stephan Beal
spending its time - maybe it's in other infrastructure. -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] What am I missing when recovering a hot journal?

2013-09-02 Thread Stephan Beal
might influence the > opening process. > A potentially useful addition for such cases might be: #define SQLITE_OPEN_IMMEDIATE 0x0010 /* Ok for sqlite3_open_v2() */ -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal ___

Re: [sqlite] to encrypt sqlite db

2013-08-31 Thread Stephan Beal
that page: "The SQLite software free and it works great." missing "is" -- - stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] recommended extension entry point name

2013-08-30 Thread Stephan Beal
ntage: a custom entrypoint allows one to combine multiple extensions into one DLL/binary. The extension then becomes more or less unaffected by any particular linkage. -- ----- stephan beal http://wanderinghorse.net/home/stephan/ http://gplus.to/sgbeal _

<    1   2   3   4   5   6   7   >