zx80 / anodb Goto Github PK
View Code? Open in Web Editor NEWConvenient Wrapper around aiosql and a Database Connection.
Home Page: https://zx80.github.io/anodb/
License: Other
Convenient Wrapper around aiosql and a Database Connection.
Home Page: https://zx80.github.io/anodb/
License: Other
Theres a typo in the check for mariadb, it should be self._db
not self.db
:
musicsite-api-1 | File "/usr/local/lib/python3.11/site-packages/anodb.py", line 88, in __init__
musicsite-api-1 | self._conn = self._connect()
musicsite-api-1 | ^^^^^^^^^^^^^^^
musicsite-api-1 | File "/usr/local/lib/python3.11/site-packages/anodb.py", line 188, in _connect
musicsite-api-1 | elif self.db == "mariadb": # pragma: no cover
musicsite-api-1 | ^^^^^^^
musicsite-api-1 | AttributeError: 'DB' object has no attribute 'db'. Did you mean: '_db'?
Thank you for your time on this package, it's a really elegant way to interface with aiosql.
I'm stuck on Python 3.9 for the moment because one of my libraries isn't compatible with 3.10+ (appdynamics). Would it be possible to bring back 3.9 support? Probably would mean having to use the old union type syntax, sorry.
I saw this comment mentioning 3.7 and 3.8 weren't compatible:
anodb/.github/workflows/anodb-package.yml
Line 15 in 8743f64
Hi,
when using psycopg (and I think also sqlite) directly, we can control transaction scope by using the connection object. This remains true even when we use aiosql
, because the connection object is "outside" the aiosql object. For example:
conn = psycopg.connect("service=foo", autocommit=True)
queries = aiosql.from_path("queries.sql")
with conn.transaction():
queries.insert_foo(conn, foo="foo")
queries.insert_bar(conn, bar="bar")
crunch_numbers_furiously_for_hours()
with conn.transaction():
queries.insert_baz(conn, baz="baz")
But with anodb
, as it is now, I have to rely on peeking inside your object and (ab)using the ostensibly private _conn
member. So you should consider one of:
_conn
member, maybe just with a getter method, or_conn
Thanks for your attention,
--
Ian
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.