gilesbrown / gsqlite3 Goto Github PK
View Code? Open in Web Editor NEWA wrapper for the 'sqlite3' module to make it play with 'gevent'.
License: MIT License
A wrapper for the 'sqlite3' module to make it play with 'gevent'.
License: MIT License
When trying to set Connection.row_factory (i.e. to return result rows as a dictionary rather than tuple) it has no effect. Appears setting these class attributes is not setting the superclass attributes
Not sure if i can use it in private projects.
The demo.py doesn't work out of the box and the sqlite3.Cursor object doesn't have next on it.
As i understand, we create connection in one thread and then execute query (reusing same connection) in another thread. From what i've read this is not safe when using sqlite3 library.
https://docs.python.org/3/library/sqlite3.html#sqlite3.connect
When using multiple threads with the same connection writing operations should be serialized by the user to avoid data corruption.
https://stackoverflow.com/a/22739924
It's not safe to share a connection between threads; at the very least you need to use a lock to serialize access
Please, release Python3 compatible version. I tried id today with Python 3.6 and after installing git version, demo.py works:
python demo.py
Populating 'demo.sqlite' ...
raw times: 0.988 0.902 0.954
gsqlite3: 10 loops,
best of 3: 90.2 msec per loop
raw times: 2.11 2.12 2.13
sqlite3: 10 loops,
best of 3: 211 msec per loop
But hte latest PyPi version (0.1.3) fails with #2
Running demo.py on python 2.7.9/gevent 1.0.1
SystemError: (libev) error creating signal/async pipe: No error
Traceback (most recent call last):
File "core.pyx", line 2044, in gevent.core._syserr_cb (gevent/gevent.core.c:34188)
File "core.pyx", line 340, in gevent.core.loop._handle_syserr (gevent/gevent.core.c:6248)
File "core.pyx", line 350, in gevent.core.loop.handle_error (gevent/gevent.core.c:6395)
File "core.pyx", line 355, in gevent.core.loop._default_handle_error (gevent/gevent.core.c:6605)
File "C:\Python27\lib\traceback.py", line 128, in print_exception
_print(file, line, '')
File "C:\Python27\lib\traceback.py", line 13, in _print
file.write(str+terminator)
KeyboardInterrupt
(libev) error creating signal/async pipe: No error
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.