Re: [sqlite] Rowid alias and description of query result: suspected tiny bug

2019-03-17 Thread Yannick Duchêne
On Sun, 17 Mar 2019 14:27:19 -0600 "Keith Medcalf" wrote: > > specifies the name you want to appear for the first column. The other names > for the other four columns are free to be whatever they want ... that is, > without an AS clause, the column names are not guaranteed to be anything >

[sqlite] Rowid alias and description of query result: suspected tiny bug

2019-03-17 Thread Yannick Duchêne
Hi people, it’s a long time I did not get there. I’m currently to create and use an SQLite DB with the Python biding APSW. For each row returned, I always retrieve the description with `Cursor.getdescription()`. Surprisingly, during a test, I noticed the name of a column as returned in the

Re: [sqlite] Suspected bug: parse error depending on platform

2017-12-24 Thread Yannick Duchêne
Finally unlike with Ubuntu, for Windows, there is not even a need to build the library, it’s already available from https://sqlite.org/download.html -- Sent from: http://sqlite.1065341.n5.nabble.com/ ___ sqlite-users mailing list

Re: [sqlite] Suspected bug: parse error depending on platform

2017-12-22 Thread Yannick Duchêne
Ok, I see. So finally using `sqlite3.sqlite_version`, it says version 3.8.11 for the Windows version and 3.11.0 for the Ubuntu version. May be I could solve it changing the sqlite3.dll which is in the isolated Python environment. I will try to build it in the virtual machine. Thanks for having

[sqlite] Suspected bug: parse error depending on platform

2017-12-22 Thread Yannick Duchêne
Hello, I’em facing an issue developing a Python+SQlite3 application on Ubuntu, to be shipped on Windows 7. The simple example below works as expected on Ubuntu, but fails on Windows 7. Both using Python3.5 and Sqlite 2.6.0, so that’s not a version issue. import sqlite3 conn =

Re: [sqlite] Kind of function out of common table expression

2017-12-20 Thread Yannick Duchêne
Indeed, a preprocessor may be an option, since all the queries are stored in text files (which are loaded by an application or directly used with copy/paste). If that's better or not than a function added per‑connection, it’s a matter of taste. I will have to decide. -- Sent from:

[sqlite] Kind of function out of common table expression

2017-12-20 Thread Yannick Duchêne
Hi there, I wonder is there is a way with SQLite3, to reuse a often used and moderately long common table expression without the need to copy/paste it in every query text it is used in. I know there is a way to add a function to SQLite connexions using DB APIs, like that of Python. Still, as

[sqlite] Unexpected echo when setting locking_mode

2017-11-18 Thread Yannick Duchêne
; If I do this, for an example other pragma: PRAGMA auto_vacuum=none; It works as expected, there is no unexpected output. -- Yannick Duchêne ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin

[sqlite] json_group_array

2016-02-05 Thread Yannick Duchêne
On Fri, 5 Feb 2016 07:51:06 + Hick Gunter wrote: > That is because count(a) and count(*) means two different things. The first > counts values, the second counts rows. What if all columns of a row, are NULL? -- Yannick Duch?ne

[sqlite] Efficient relational SELECT

2016-02-04 Thread Yannick Duchêne
On Thu, 4 Feb 2016 20:40:56 + Simon Slavin wrote: > > On 4 Feb 2016, at 7:16pm, Luuk wrote: > > > Will this simple solution be too slow?: > > > > SELECT id, room, date, time > > FROM rooms > > LEFT JOIN bookngs ON rooms.id=bookings.room > > GROUP BY rooms.id, bookings.date > > HAVING

[sqlite] a sqlite database error

2016-02-04 Thread Yannick Duchêne
Hello, and welcome, Frank, You just forget to tell what the error was :-P . By the way, what returned the error? Was this SQLite3 itself or a wrapper around it? On Wed, 3 Feb 2016 14:22:40 +0800 "" <1072579296 at qq.com> wrote: > Hello, my name is Frank. Two days ago, I operated sqlite

[sqlite] IS a SQLite db of small size as good as reliable cache?

2016-02-03 Thread Yannick Duchêne
On Wed, 3 Feb 2016 23:25:33 +0100 GB wrote: > So where have you got this wisdom from? It's just plain Bullshit! > > Just as most cache managers do, Windows cache manager uses some sort of > LRU caching scheme. So all data once read from file is kept in memory > until either some memory

[sqlite] Bug: Successfully committed transaction rolled back after power failure

2016-02-03 Thread Yannick Duchêne
On Wed, 03 Feb 2016 06:30:13 -0700 "Keith Medcalf" wrote: > > Is this on windows? Any errors in the Eventlogs to the tune "Oooopsie -- > accidentally threw away your data instead of writing it to disk"? Windows > does this quite commonly under some circumstances. MicroSoft created the bug

[sqlite] Bug: Successfully committed transaction rolled back after power failure

2016-02-02 Thread Yannick Duchêne
On Thu, 28 Jan 2016 14:55:28 + Simon Slavin wrote: > > On 28 Jan 2016, at 1:38pm, Bernard McNeill wrote: > > > === > > Like the user reading ?saving OK? and throwing away the > > Post-It with the original information > > === > > > > This is exactly my concern. > > The user throwing away

[sqlite] Is the first column of a composite primary key, special?

2016-02-02 Thread Yannick Duchêne
On Sun, 31 Jan 2016 18:15:48 -0500 "James K. Lowden" wrote: > > The relational model, as you well know, doesn't describe > implementation. It's math. It says what relations are, and how > they're manipulated. One data type, and an algebra closed over that > domain. Math doesn't have

[sqlite] Pragma automatic_index and ROWID: which one is really responsible for automatic indexes?

2016-02-01 Thread Yannick Duchêne
On Thu, 28 Jan 2016 22:08:02 +0200 R Smith wrote: > I think you are misunderstanding the Pragma and the idea of automatic > indices. An automatic Index might be created on a table that doesn't > have an adequately assigned primary key. It might also be created during > a query (mostly SELECT

[sqlite] Is the first column of a composite primary key, special?

2016-01-31 Thread Yannick Duchêne
On Sun, 31 Jan 2016 17:22:37 + Simon Slavin wrote: > > Ignore all the above. There are rare situations where they're useful but the > situation you're in is helped far more by using the phonebook analogy earlier > posters used than by trying to use the above. > > Think about pure SQL,

[sqlite] Is the first column of a composite primary key, special?

2016-01-31 Thread Yannick Duchêne
On Sun, 31 Jan 2016 10:45:59 -0700 "Keith Medcalf" wrote: > create table PhoneDirectory > ( > surname_id integer not null references Surnames, > given_id integer not null references GivenNames, > address_id integer not null references Addresses, > PhoneNumber text collate nocase primary key

[sqlite] Wish List for 2016: High Level API for Object Oriented Interactive Languages

2016-01-31 Thread Yannick Duchêne
On Sun, 31 Jan 2016 09:42:28 -0700 "Keith Medcalf" wrote: > > And I thought the "Object Oriented" jihad blew up when it was discovered to > be counter to productivity and performance in the 1990's and that it did not > provide a single one of the "advantages" claimed by its mujahedeen

[sqlite] Is the first column of a composite primary key, special?

2016-01-31 Thread Yannick Duchêne
On Sun, 31 Jan 2016 16:14:45 +0200 R Smith wrote: I'm replying to Igor too with this message, as both of you had a similar answer. > > First understand what an Index is and how it works. > > Imagine you are asked to find all the people whose surnames are > "Duch?ne" from the telephone

[sqlite] Is the first column of a composite primary key, special?

2016-01-31 Thread Yannick Duchêne
Hi all, Another mystery to me. Given this test table: CREATE TABLE t (a TEXT, b TEXT, c INTEGER, PRIMARY KEY (a, b, c)) ??this query: SELECT Sum(c) FROM t GROUP BY a ??executes faster than any of these two: SELECT Sum(c) FROM t GROUP BY b SELECT Sum(c) FROM t GROUP BY c ?

[sqlite] Find out how many times does SQLite hit the disk?

2016-01-31 Thread Yannick Duchêne
On Sat, 30 Jan 2016 20:36:55 -0800 J Decker wrote: > On Sat, Jan 30, 2016 at 8:09 PM, J Decker wrote: > > could use a tool like ProcMon and filter to disk activity on a > > specified file to see... > > https://technet.microsoft.com/en-us/sysinternals/processmonitor.aspx?f=255=-2147217396 > >

[sqlite] Wish List for 2016: High Level API for Object Oriented Interactive Languages

2016-01-31 Thread Yannick Duchêne
On Sat, 30 Jan 2016 23:03:29 + Simon Slavin wrote: > > On 30 Jan 2016, at 8:13pm, Yannick Duch?ne > wrote: > > > In my opinion (which some others share), OO is a bag of miscellaneous > > things which are better tools and better understood when accosted > > individually. Just trying to

[sqlite] Wish List for 2016: High Level API for Object Oriented Interactive Languages

2016-01-31 Thread Yannick Duchêne
On Sat, 30 Jan 2016 20:50:17 -0500 Jim Callahan wrote: > I am not interested in a complete ORM; what I am interested is when the > object-oriented language supports a SQL-R-like object. In R, the object is > called a data.frame and the package "Pandas" supplies a similar data frame > object to

[sqlite] Wish List for 2016: High Level API for Object Oriented Interactive Languages

2016-01-30 Thread Yannick Duchêne
On Sat, 30 Jan 2016 14:56:15 -0500 "James K. Lowden" wrote: > On Thu, 28 Jan 2016 16:47:40 -0500 > Jim Callahan wrote: > > > I am hopeful this new JDBC based interface will provide as > > satisfactory high level channel between SQLite3 and Python. > > As someone who's written a couple of OO

[sqlite] `explain query plan`: does it have any side effects?

2016-01-30 Thread Yannick Duchêne
On Sat, 30 Jan 2016 19:07:21 + Simon Slavin wrote: > > On 30 Jan 2016, at 6:56pm, Yannick Duch?ne > wrote: > > > > That's strange, or may be it's SQLiteBrowser specific (I'm using it to test > > queries and get timings). > > Oh, you're not using your own code. > > Download the SQLite

[sqlite] `explain query plan`: does it have any side effects?

2016-01-30 Thread Yannick Duchêne
On Sat, 30 Jan 2016 19:03:12 +0100 Yannick Duch?ne wrote: > > On 30 Jan 2016, at 4:55pm, Yannick Duch?ne > > wrote: > > > > > Tweaking a query, I notice a query executed after I did an `explain query > > > plan `, executes faster than before it occured. > > > > Computer reads data from disk

[sqlite] `explain query plan`: does it have any side effects?

2016-01-30 Thread Yannick Duchêne
On Sat, 30 Jan 2016 17:41:49 + Simon Slavin wrote: > > On 30 Jan 2016, at 4:55pm, Yannick Duch?ne > wrote: > > > Tweaking a query, I notice a query executed after I did an `explain query > > plan `, executes faster than before it occured. > > Computer reads data from disk when you do

[sqlite] Best way to store only date

2016-01-30 Thread Yannick Duchêne
On Sat, 30 Jan 2016 14:22:06 +0100 "E.Pasma" wrote: > With respect to Igor's suggestion, mmdd (as integer), why not leave out > the century? I prefer the oldfashoned yymmdd. And what about a planned Y3K bug? -:D (teasing) > The diagram got broken in my email and here is another try: > >

[sqlite] `explain query plan`: does it have any side effects?

2016-01-30 Thread Yannick Duchêne
Funny real thing or illusion? Tweaking a query, I notice a query executed after I did an `explain query plan `, executes faster than before it occured. I checked multiple times in case it could be due to something else in the environment or due to since how long the SQLite connexion is opened,

[sqlite] Pragma automatic_index and ROWID: which one is really responsible for automatic indexes?

2016-01-29 Thread Yannick Duchêne
On Thu, 28 Jan 2016 19:18:06 -0500 "Keith Medcalf" wrote: > > When you create a table thusly: > > create table x (x primary key, y, z); > > you are creating a rowid table with columns x, y, an z. You are also saying > that you want x to be the primary key. Therefore, you will get a table

[sqlite] Pragma automatic_index and ROWID: which one is really responsible for automatic indexes?

2016-01-29 Thread Yannick Duchêne
On Fri, 29 Jan 2016 01:34:01 +0200 R Smith wrote: > > I think the dictionary would be faster for this use-case (mostly cause > it runs in-memory and we do not require all the DB data guarantees for > the initial sort). However, the fastest way in SQL would be to use a > temporary table, do

[sqlite] Pragma automatic_index and ROWID: which one is really responsible for automatic indexes?

2016-01-28 Thread Yannick Duchêne
On Thu, 28 Jan 2016 22:08:02 +0200 R Smith wrote: > I think you are misunderstanding the Pragma and the idea of automatic > indices. An automatic Index might be created on a table that doesn't > have an adequately assigned primary key. It might also be created during > a query (mostly SELECT

[sqlite] Pragma automatic_index and ROWID: which one is really responsible for automatic indexes?

2016-01-28 Thread Yannick Duchêne
On Thu, 28 Jan 2016 19:59:02 +0100 Dominique Devienne wrote: > Not sure to understand what you expect this pragma to do, but inserts > typically don't involve automatic indexes, which are used only in queries > (selects). I though it was responsible for the `sqlite_autoindex_"table_name"_N`

[sqlite] Is there an index of conformances and deviations against standard SQL?

2016-01-28 Thread Yannick Duchêne
On Wed, 27 Jan 2016 20:10:01 + Simon Slavin wrote: > There are later standards for SQL and SQLite and other SQL implementations > include some of the features in them. But at this point different > implementations start to diverge from one-another far more. With this, you fully answered

[sqlite] Pragma automatic_index and ROWID: which one is really responsible for automatic indexes?

2016-01-28 Thread Yannick Duchêne
Hi people, I though automatic index was controlled by the pragma `automatic_index`, which seems to do nothing for me, unless I'm doing it the wrong way, while `WITHOUT ROWID` on table creations, seems to effectively prevent automatic indexes, the latter with or without the `PRAGMA

[sqlite] `UNIQUE` constraint allows multiple NULL: is this expected?

2016-01-27 Thread Yannick Duchêne
On Wed, 27 Jan 2016 14:38:41 -0500 Richard Hipp wrote: > > See https://www.sqlite.org/nulls.html > The most important part to me, is this one: > The fact that NULLs are distinct for UNIQUE columns but are indistinct for > SELECT DISTINCT and UNION continues to be puzzling. It seems that

[sqlite] `UNIQUE` constraint allows multiple NULL: is this expected?

2016-01-27 Thread Yannick Duchêne
On Wed, 27 Jan 2016 14:17:49 -0500 Igor Tandetnik wrote: > On 1/27/2016 2:10 PM, Yannick Duch?ne wrote: > > `UNIQUE` constraint allows multiple NULL: is this expected? > > http://www.sqlite.org/lang_createtable.html > "For the purposes of UNIQUE constraints, NULL values are considered >

[sqlite] Is there an index of conformances and deviations against standard SQL?

2016-01-27 Thread Yannick Duchêne
I like SQLite because it's simple and also because I believe it sticks to the standard, therefore I get the habit to use SQLite to learn standard SQL. Today, I came to a page from the documentation, about a construct which is supported for compatibility with MySQL and elsewhere I learned (if

[sqlite] `UNIQUE` constraint allows multiple NULL: is this expected?

2016-01-27 Thread Yannick Duchêne
Hi people out there, I initially subscribed for another question (which I will post later), when I came to something which surprised me. Given this: CREATE TABLE test (value TEXT UNIQUE) On this: INSERT INTO test (value) VALUES('A'); INSERT INTO test (value) VALUES('A') ? the