On Wed, Aug 7, 2019 at 2:28 AM Dennis Lee Bieber wrote:
>
> On Mon, 5 Aug 2019 20:12:27 +0200, Karsten Hilbert
> declaimed the following:
>
>
> >Transactions involving several commands may require passing
> >around of connections and/or cursors, however.
> >
>
> Probably both -- as I reca
* To be reliably INSERTed Byte data should be first converted to
sqlite3.Binary(my_data) explicitly
Interesting. Is that Python 2 specific, or also in Python 3. Because
the latter would surprise me (not saying it isn't the case).
Only tried on Python 3. I'm inserting raw byte versions of web
On 06Aug2019 00:01, Jonathan Moules wrote:
Some gotcha tips from using SQLite with Python that I've encountered.
[...]
* To be reliably INSERTed Byte data should be first converted to
sqlite3.Binary(my_data) explicitly
Interesting. Is that Python 2 specific, or also in Python 3. Because the
Some gotcha tips from using SQLite with Python that I've encountered.
You may already know some/all of these:
* SQLite doesn't have a "Truncate" function - simply delete the file if
possible for larger datasets.
* Explicitly committing is good because the default python sqlite3
library does it
On Tue, Aug 6, 2019 at 7:45 AM David Raymond wrote:
> The context manager transaction feature I can see using, and might actually
> start switching to it as it's explicit enough. Though oddly, __enter__
> doesn't seem to actually begin a transaction, not even a deferred one. It's
> only __exit_
"What's the advantage of this over letting the connection object do
that for you? As the context manager exits, it will automatically
either commit or roll back. If you want to guarantee closing _as
well_, then you can do that, but you can at least use what already
exists."
After review I guess I
On Tue, Aug 6, 2019 at 5:05 AM David Raymond wrote:
> I believe the default Connection context manager is set up for the context to
> be a single transaction, with a commit on success or a rollback on a failure.
> As far as I know it does NOT close the connection on exiting the context
> manage
Not a full expert, but some notes:
I believe the default Connection context manager is set up for the context to
be a single transaction, with a commit on success or a rollback on a failure.
As far as I know it does NOT close the connection on exiting the context
manager. That only happens aut
On Mon, Aug 05, 2019 at 08:12:27PM +0200, Karsten Hilbert wrote:
> Transactions involving several commands may require passing
> around of connections and/or cursors, however.
Among chains of python code, that is.
Karsten
--
GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B
--
https://mai
On Mon, Aug 05, 2019 at 01:49:24PM -0400, Dave via Python-list wrote:
> * Passing connections and cursors - good, bad indifferent? I try to avoid
> passing file handles unless necessary, so I view connections and cursors the
> same.
Connections may be more long-lived, per thread perhaps.
Cursor
10 matches
Mail list logo