[sqlite] Random-access sequences

2016-03-02 Thread R Smith
On 2016/03/02 2:26 AM, James K. Lowden wrote: > On Tue, 1 Mar 2016 08:15:25 -0500 > Richard Damon wrote: > >>> The theoretical maximum number of rows in a table is 264 >>> (18446744073709551616 or about 1.8e+19). This limit is unreachable >>> since the maximum database size of 140 terabytes

[sqlite] CREATE TABLE parser

2016-03-02 Thread Marco Bambini
Hi all, I developed a CREATE TABLE parser in C that is able to extract every details about an sqlite table (table and columns constraints, foreign keys, flags and so on). So far it seems to work pretty well but I would like to stress test it before releasing it as open source on GitHub. Anyone

[sqlite] Why does the stored schema strings have their beginning upper-cased?

2016-03-02 Thread Olivier Mascia
-- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 842 bytes Desc: Message signed with OpenPGP using GPGMail URL: <http://mailinglists.sqlite.org/cgi-bin/mailman/private/sqlite-users/attachments/20160302/a1b59540/attachment.pgp>

[sqlite] CREATE TABLE parser

2016-03-02 Thread R Smith
On 2016/03/02 9:51 AM, Marco Bambini wrote: > Hi all, > I developed a CREATE TABLE parser in C that is able to extract every details > about an sqlite table (table and columns constraints, foreign keys, flags and > so on). > So far it seems to work pretty well but I would like to stress test

[sqlite] Why does the stored schema strings have their beginning upper-cased?

2016-03-02 Thread Clemens Ladisch
Olivier Mascia wrote: > I have been puzzled about its habit to convert to upper case the beginning of > each schema statement > > Is there a functional reason to do this? The documentatin says: | The sqlite_master.sql column stores SQL text

[sqlite] Why does the stored schema strings have their beginning upper-cased?

2016-03-02 Thread Simon Slavin
On 2 Mar 2016, at 9:16am, Clemens Ladisch wrote: > It does not say _why_ these normalizations are applied, but I'd guess it > makes searching for specific entries easier. In an informal, non-programming way, I'll just comment that the style here is that keywords are written in upper case and

[sqlite] Why does the stored schema strings have their beginning upper-cased?

2016-03-02 Thread Quan Yong Zhai
VACUUM depends on upper cased "CREATE [UNIQUE] INDEX" sql text in sqlite_master when " pragma case_sensitive_like = on " , or the VACUUM will not work properly ???: Simon Slavin : ?2016/?3/?2 17:27 ???: SQLite mailing

[sqlite] CREATE TABLE parser

2016-03-02 Thread Clemens Ladisch
Marco Bambini wrote: > I developed a CREATE TABLE parser in C Did you duplicate the SQLite SQL parser? Or is your parser supposed to have differences? > I would like to stress test it before releasing it as open source on GitHub. Without the source, finding errors would not be as easy.

[sqlite] [System.Data.SQLite] int overflow in date handling when unixepoch is used

2016-03-02 Thread Jann Roder
Hi, When I set the dateformat to unixepoch the maximum date I can get back from a query is 2038-01-19. This appears to be a problem in the wrapper as SQLite itself is using 64bit integers for dates. You can reproduce the problem like this: [Test] public void

[sqlite] CREATE TABLE parser

2016-03-02 Thread Marco Bambini
I developed the parser myself. Here you go a link to the GitHub page: https://github.com/marcobambini/sqlite-createtable-parser -- Marco Bambini http://www.sqlabs.com http://twitter.com/sqlabs http://instagram.com/sqlabs > On 02 Mar 2016, at 11:50, Clemens Ladisch wrote: > > Marco Bambini

[sqlite] Why does the stored schema strings have their beginning upper-cased?

2016-03-02 Thread Richard Hipp
On 3/2/16, Olivier Mascia wrote: > Hello, > > This is really not important, nor a bug, but since I started with SQLite I > have been puzzled about its habit to convert to upper case the beginning of > each schema statement (CREATE TABLE, CREATE INDEX). It looks like it stores > and keeps the

[sqlite] CREATE TABLE parser

2016-03-02 Thread Luca Ferrari
On Wed, Mar 2, 2016 at 1:10 PM, Marco Bambini wrote: > I developed the parser myself. Great job but...what is the aim? Why one should use this instead of, let's say, Perl SQL::Parser ? Luca

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-02 Thread 邱朗
Here(http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor) said "Do not try to implement a scrolling window using LIMIT and OFFSET. Doing so will become sluggish as the user scrolls down toward the bottom of the list.?. But the page also said "This information is obsolete?

[sqlite] possible sqlite3_step() bug in sqlite 3.10.0

2016-03-02 Thread janezz55 .
The sqlite3_reset() call is supposedly optional since version 3.7.0 if a statement returned SQLITE_DONE, but I find this is not the case for prepared INSERT and DELETE statements. Stepping those prepared statements does not return an error, but it also does not execute the prepared statement.

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-02 Thread Clemens Ladisch
?? wrote: > Here(http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor) said "Do > not try to implement a scrolling window using LIMIT and OFFSET. Doing > so will become sluggish as the user scrolls down toward the bottom of > the list.?. But the page also said "This information is obsolete?

[sqlite] CREATE TABLE parser

2016-03-02 Thread Marco Bambini
> On 02 Mar 2016, at 13:32, Luca Ferrari wrote: > > On Wed, Mar 2, 2016 at 1:10 PM, Marco Bambini wrote: >> I developed the parser myself. > > Great job but...what is the aim? > Why one should use this instead of, let's say, Perl SQL::Parser >

[sqlite] CREATE TABLE parser

2016-03-02 Thread Noel Frankinet
Hello, Great work, but why not generate it with bison/flex ? sql grammar is available ? Just a question ? No?l On 2 March 2016 at 14:47, Marco Bambini wrote: > > > On 02 Mar 2016, at 13:32, Luca Ferrari wrote: > > > > On Wed, Mar 2, 2016 at 1:10 PM, Marco Bambini wrote: > >> I developed

[sqlite] Why does the stored schema strings have their beginning upper-cased?

2016-03-02 Thread Olivier Mascia
> Le 2 mars 2016 ? 13:26, Richard Hipp a ?crit : > > On 3/2/16, Olivier Mascia wrote: >> Hello, >> >> This is really not important, nor a bug, but since I started with SQLite I >> have been puzzled about its habit to convert to upper case the beginning of >> each schema statement (CREATE

[sqlite] Are BLOB stored inline with the rest of the record fields?

2016-03-02 Thread Eric Grange
Hi, I am wondering if very small BLOBs are stored inline with the record fields (in the same page) or in another page? So far I had not worried about it, but now I have a usage case where I need to store 128 and 256 bit integers (numbers, not IDs or hashes), SQLite does not support such large

[sqlite] Are BLOB stored inline with the rest of the record fields?

2016-03-02 Thread Simon Slavin
On 2 Mar 2016, at 4:47pm, Eric Grange wrote: > I am wondering if very small BLOBs are stored inline with the record fields > (in the same page) or in another page? All BLOBs are stored inline. The only complication comes when the total row length is longer than a page. Simon.

[sqlite] [System.Data.SQLite] int overflow in date handling when unixepoch is used

2016-03-02 Thread Joe Mistachkin
Jann Roder wrote: > > When I set the dateformat to unixepoch the maximum date I can get back > from a query is 2038-01-19. This appears to be a problem in the wrapper > as SQLite itself is using 64bit integers for dates. > Thanks for the clear and concise report. This issue should now be fixed

[sqlite] How to check if connection to main database is still open or closed before new query ?

2016-03-02 Thread James K. Lowden
On Tue, 1 Mar 2016 17:13:29 + a a wrote: > I want to check after a while if the connection is allready closed or > not for the simple reason not to reopen the database but if is open > to run a query or if it is closed to reopen the database and then run > the query. I don't blame you for

[sqlite] Are BLOB stored inline with the rest of the record fields?

2016-03-02 Thread Richard Hipp
On 3/2/16, Eric Grange wrote: > I am planning to store them as > little-endian binary blobs, so that the BINARY collation can work for > sorting, Surely you mean big-endian? -- D. Richard Hipp drh at sqlite.org

[sqlite] Are BLOB stored inline with the rest of the record fields?

2016-03-02 Thread R Smith
On 2016/03/02 6:47 PM, Eric Grange wrote: > Hi, > > I am wondering if very small BLOBs are stored inline with the record fields > (in the same page) or in another page? > > So far I had not worried about it, but now I have a usage case where I need > to store 128 and 256 bit integers (numbers,

[sqlite] Are BLOB stored inline with the rest of the record fields?

2016-03-02 Thread Doug Currie
On Wed, Mar 2, 2016 at 4:42 PM, R Smith wrote: > > > Personally, unless your space is constrained, I would simply save the > numbers as strings, perhaps Hex or BCD with leading chars and convert as > needed. This would sort correctly without tricks and not do much worse for > space. (Base64 would

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-02 Thread James K. Lowden
On Wed, 2 Mar 2016 14:12:04 +0100 Clemens Ladisch wrote: > > https://www.sqlite.org/lang_select.html talks about LIMIT & OFFSET, > > without mentioning that is a bad idea. > > Neither does it mention that it is a good idea. > > > can I do that or not (will it become sluggish if I do that) ? >

[sqlite] DB-Journal

2016-03-02 Thread Itxaso Perez
Hi! I am modifying an app which works with Visual Studio.Net + NHibernate + SQLite When I have a power loss or a crash in the PC it appears a DB-Journal and I can?t open my app. The error concerns to NHibernate but I have some questions: - If this occurss (power loss) using only SQLite

[sqlite] DB-Journal

2016-03-02 Thread Warren Young
On Mar 2, 2016, at 6:00 PM, Simon Slavin wrote: > > On 2 Mar 2016, at 1:48pm, Itxaso Perez wrote: > >> - How can I 'execute' the DB-Jounal file just to try to 'correct' the >> database before execting NHibernate? > > Having a journal file on disk should not crash your app. It is possible

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-02 Thread Darren Duncan
On 2016-03-02 5:02 AM, ?? wrote: > Here... said "Do not try to implement a scrolling window using LIMIT and > OFFSET. Doing so will become sluggish as the user scrolls down toward the > bottom of the list.?. But the page also said "This information is obsolete? > ... talks about LIMIT & OFFSET,

[sqlite] pragma foreign_keys attribute of connection?

2016-03-02 Thread Ward WIllats
Hello. We have multiple processes trying to access an sqlite DB while one of them is inside a transaction trying to migrate the schema. Before the migrate transaction is started, pragma foreign_keys=0 is executed. Yet, in the middle of the migration, we get a constraint violation as though

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-02 Thread Darren Duncan
On 2016-03-02 6:48 PM, ?? wrote: >> A better way that is very similar is to use WHERE and LIMIT instead. > > I know that but as I just replied to this thread, if I do that I will then > have to record each columns I use for each table I want scroll cursor. So > from the implementation point of

[sqlite] Can I implement a scrolling window using LIMIT and OFFSET ?

2016-03-02 Thread Darren Duncan
Using OFFSET means you have to sort and count all the records you're skipping before getting to the ones you want, and using WHERE means you can avoid counting and only sort the ones you're not skipping. That is how it is, regardless of what that document you saw says. -- Darren Duncan On

[sqlite] pragma foreign_keys attribute of connection?

2016-03-02 Thread Ward WIllats
> On Mar 2, 2016, at 6:53 PM, Ward WIllats wrote: > > Now, this diagnosis may or may not be correct, Indeed, it is not. Never mind! Thanks! -- Ward

[sqlite] pragma foreign_keys attribute of connection?

2016-03-02 Thread Keith Medcalf
On Wednesday, 2 March, 2016 19:54, Ward WIllats wrote: > We have multiple processes trying to access an sqlite DB while one of them > is inside a transaction trying to migrate the schema. Before the migrate > transaction is started, pragma foreign_keys=0 is executed. Yet, in the > middle of

[sqlite] Understanding conditional triggers

2016-03-02 Thread Sam Carleton
I am working on a trigger that only needs to be fired when the value for the column 'Selected' is 1. How exactly do I write that trigger? Here is what I have come up with: CREATE TRIGGER IF NOT EXISTS tu_Favorite_add_to_SlideShowImage AFTER UPDATE ON Favorite FOR EACH ROW *WHEN