Comments (3)
Are you thinking about a solution without SQLAlchemy / Alembic?
from databases.
Kinda. Eg. right now if test cases are using engine.create_all()
, engine.drop_all()
you're having to use a regular syncronous driver. That's fine but it means that we always have two sets of dependencies. An async database driver for the regular code, and a sync database driver for any migrations or table setup. It'd be nice if we didn't need to do that.
from databases.
Something like...
- async def execute(self, query: ClauseElement) -> typing.Any:
+ async def execute(
+ self, query: typing.Union[ClauseElement, DDLElement]
+ ) -> typing.Any:
assert self._connection is not None, "Connection is not acquired"
- query, args, result_columns = self._compile(query)
- return await self._connection.fetchval(query, *args)
+ if isinstance(query, DDLElement):
+ compiled = query.compile(dialect=self._dialect).string
+ await self._connection.execute(compiled)
+ return
+ else:
+ query, args, result_columns = self._compile(query)
+ return await self._connection.fetchval(query, *args)
from databases.
Related Issues (20)
- Unable to retrieve foreignkey relation object from select statement HOT 2
- Password containing `/` cannot be used (MySQL)
- Support for UNIX domain socket for MySQL
- No module named 'asyncmy.connection' on python 3.11.3
- Warn for open transactions when a connection is garbage collected
- Unable to connect to database in docker
- MySQL Connection Pool Doesn't Seem to Work HOT 3
- Drop support for python 3.7 HOT 1
- New test `test_should_remove_ref_on_disconnect` in 0.8.0 fails on Fedora Linux HOT 10
- `IndexError` on force_rollback of Transaction in tests. HOT 13
- ImportError Postgresql HOT 1
- Transaction and gather HOT 2
- session manager/ session maker
- Allow passing string values for ssl query string in PostgreSQL URL HOT 1
- Version not match (0.8.0) depends on sqlalchemy (>=1.4.42,<1.5) HOT 2
- mypy's "has no attribute" error
- create table does not create unique keys and indexes
- new 0.8 version for sqlite connection with '?mode=ro' not working, Error can't open database
- Caching disabled in sqlalchemy queries HOT 1
- Potential Inefficiency in Connection Management Leading to "Too Many Connections" Error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from databases.