Re: [sqlite] Single or double quotes when defining alias?

2019-10-25 Thread Keith Medcalf
On Friday, 25 October, 2019 20:45, Simon Slavin wrote: >On 25 Oct 2019, at 10:55pm, Thomas Kurz wrote: >> SELECT column2 AS "d" >If you want to do it, do it like that. Double quotes indicate an entity >name. Single quotes indicate a string of characters. >However, almost nobody quotes

Re: [sqlite] Single or double quotes when defining alias?

2019-10-25 Thread Simon Slavin
On 25 Oct 2019, at 10:55pm, Thomas Kurz wrote: > SELECT column2 AS "d" If you want to do it, do it like that. Double quotes indicate an entity name. Single quotes indicate a string of characters. However, almost nobody quotes entity names these days. The language is written so that you

Re: [sqlite] Single or double quotes when defining alias?

2019-10-25 Thread František Kučera
Dne 25. 10. 19 v 23:55 Thomas Kurz napsal(a) > this might be a stupid question, but do I have to use single or double quotes > when defining an alias? > > SELECT column1 AS 'c' > --or-- > SELECT column2 AS "d" > > On the one hand, the name refers to a column or table identifier. On the > other

Re: [sqlite] Where is in_transaction of sqlite3.Connection?

2019-10-25 Thread Peng Yu
Forget about. I think in_transaction is only available in python3 but not python2. On 10/25/19, Peng Yu wrote: > https://docs.python.org/3.9/library/sqlite3.html > > The manual says in_transaction is an attribute of sqlite3.Connection. > But I don't see it. Why? > > """ > in_transaction > True

Re: [sqlite] What is the default value of isolation_level?

2019-10-25 Thread Keith Medcalf
On Friday, 25 October, 2019 13:49, Peng Yu wrote: >isolation_level is an empty string by default as shown below. But the >python manual does not say that it can take an empty string. What does >an empty string mean? Is it equivalent to None? Thanks. No. It means use the default. And sqlite3

Re: [sqlite] What does commit actually do?

2019-10-25 Thread Peng Yu
The manual says this. "The Python sqlite3 module by default issues a BEGIN statement implicitly before a Data Modification Language (DML) statement (i.e. INSERT/UPDATE/DELETE/REPLACE)." > If you did NOT specify "isolation_level = None" in the .connect() call then > you probably ARE in a

Re: [sqlite] What does commit actually do?

2019-10-25 Thread Keith Medcalf
You can tell if you are in a transaction by the in_transaction property of the connection. This tracks whether or not a BEGIN of some kind has been issued by the wrapper (either through magic or because you explicitly issued a command to BEGIN a transaction). If in_transaction is True, then

Re: [sqlite] What is the default value of isolation_level?

2019-10-25 Thread Peng Yu
So basically an empty string in isolation_level is the same as "DEFERRED"? This is confusing. I think it should have been implemented so that the value of the isolation_level attribute is DEFERRED when it is not specified in .connect(). On 10/25/19, David Raymond wrote: >

Re: [sqlite] Stream loading SQL script

2019-10-25 Thread Keith Medcalf
The sqlite3 command line shell already does this. see function process_input -- The fact that there's a Highway to Hell but only a Stairway to Heaven says a lot about anticipated traffic volume. >-Original Message- >From: sqlite-users On >Behalf Of František Kucera >Sent: Friday, 25

Re: [sqlite] What is the default value of isolation_level?

2019-10-25 Thread David Raymond
https://docs.python.org/3.7/library/sqlite3.html#controlling-transactions "If you specify no isolation_level, a plain BEGIN is used, which is equivalent to specifying DEFERRED." I believe the empty string qualifies as "no isolation_level" for this. -Original Message- From:

[sqlite] What is the default value of isolation_level?

2019-10-25 Thread Peng Yu
Hi, isolation_level is an empty string by default as shown below. But the python manual does not say that it can take an empty string. What does an empty string mean? Is it equivalent to None? Thanks. https://docs.python.org/3/library/sqlite3.html#connection-objects """ isolation_level Get

[sqlite] Single or double quotes when defining alias?

2019-10-25 Thread Thomas Kurz
Dear all, this might be a stupid question, but do I have to use single or double quotes when defining an alias? SELECT column1 AS 'c' --or-- SELECT column2 AS "d" On the one hand, the name refers to a column or table identifier. On the other hand, at the time of using this statement, the

[sqlite] Where is in_transaction of sqlite3.Connection?

2019-10-25 Thread Peng Yu
https://docs.python.org/3.9/library/sqlite3.html The manual says in_transaction is an attribute of sqlite3.Connection. But I don't see it. Why? """ in_transaction True if a transaction is active (there are uncommitted changes), False otherwise. Read-only attribute. """ ==> main.py <==

Re: [sqlite] What does commit actually do?

2019-10-25 Thread David Raymond
"I just use the default .connect() without specifying isolation_level explicitly. Then I am in a transaction?" E, umm, well. Even regular users may not know the answer to that do to "automatic stuff behind the scenes" which may have corner cases or maybe bad documentation. Which is

Re: [sqlite] What is the default value of isolation_level?

2019-10-25 Thread Keith Medcalf
On Friday, 25 October, 2019 14:02, Peng Yu wrote: >So basically an empty string in isolation_level is the same as >"DEFERRED"? This is confusing. I think it should have been implemented >so that the value of the isolation_level attribute is DEFERRED when it >is not specified in .connect(). But

Re: [sqlite] What is the default value of isolation_level?

2019-10-25 Thread Peng Yu
> if the isolation_level is None then no extra command is issued. > if the isolation_level is '' then the command BEGIN TRANSACTION; is issued > if the isolation_level is 'DEFERRED' then the command BEGIN DEFERRED > TRANSACTION; is issued > if the isolation_level is 'IMMEDIATE' then the command

Re: [sqlite] What is the default value of isolation_level?

2019-10-25 Thread David Raymond
https://www.sqlite.org/lang_transaction.html Depending on how they're implementing it, one could argue that they're just copying the specs for SQLite and saying "if you're not gonna specify it, then we're not gonna specify it, and we're just gonna let the SQLite library do with it as it pleases

[sqlite] Stream loading SQL script

2019-10-25 Thread František Kučera
Hello, I am developing a tool* in C++ and one of its features will be that it will load an SQL script (CREATE TABLE, INSERT), execute it, then execute some queries and print results. The SQL script might be long and I do not want to load it whole in the memory. Usually it will easily fit, but

Re: [sqlite] What does commit actually do?

2019-10-25 Thread David Raymond
"https://docs.python.org/2/library/sqlite3.html; Also, please consider going to Python 3 instead of 2. ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] What does commit actually do?

2019-10-25 Thread David Raymond
This question could span the entire range of experience level from beginner to expert. When you're in a transaction, .commit() says "make everything done in this transaction on this connection permanent." If there are any crashes or improper disconnections in the middle of a transaction then

Re: [sqlite] proposal for write-lock on "commit" rather than "begin transaction"

2019-10-25 Thread Brannon King
> > Two users – members of staff – enter data. Each user enters a new > invoice. One of these entries gets rolled back. What should their > software do ? Or should it just return an error message to the user ? > Multi-user data entry is not a part of my intended use case. I think other

Re: [sqlite] What does commit actually do?

2019-10-25 Thread Keith Medcalf
On Friday, 25 October, 2019 10:44, Peng Yu wrote: >The python manual just tell me what I should do but it is not very >clear what commit() actually does under the hood. >https://docs.python.org/2/library/sqlite3.html >""" >commit() >This method commits the current transaction. If you

[sqlite] What does commit actually do?

2019-10-25 Thread Peng Yu
The python manual just tell me what I should do but it is not very clear what commit() actually does under the hood. https://docs.python.org/2/library/sqlite3.html """ commit() This method commits the current transaction. If you don’t call this method, anything you did since the last call

Re: [sqlite] proposal for write-lock on "commit" rather than "begin transaction"

2019-10-25 Thread Simon Slavin
On 25 Oct 2019, at 5:07pm, Brannon King wrote: > Once one connection commits, the other connection will no longer be allowed > to commit. It will be forced to rollback (or perhaps rebase if there are no > conflicts). While lots of software supports rollback, in that it issues an error message

[sqlite] proposal for write-lock on "commit" rather than "begin transaction"

2019-10-25 Thread Brannon King
This is a request for a small change to the handling of multiple connections. I think it would significantly enhance the usefulness there via allowing multiple "views" of the data. Consider that I have two simultaneous connections to one file, named Con1 and Con2. They could be in one process or

[sqlite] Making SQLite LSM extension another flagship software

2019-10-25 Thread Amirouche Boubekki
Hello! I want to ask whether it is feasible to make SQLite LSM extension more visible as another flagship software from the sqlite family. # Proposal - Change the name to something more memorable, for instance: okvslite (prefered), lsmlite or add-your-proposal-here - Move the code (and

Re: [sqlite] Can SQLite do this in a single query?

2019-10-25 Thread Winfried
Keith Medcalf wrote > Well, "paint" is to draw your output. Thank you. -- Sent from: http://sqlite.1065341.n5.nabble.com/ ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org