Comments (6)
It looks like SQLAlchemy's reflect() method supports an only
argument that can be used to limit the reflection to subset of table names. However, alchy doesn't expose that option in the Manager.reflect()
method (but obviously you can subclass it to extend that behavior).
For view, SQLAlchemy has a way to reflect views: http://docs.sqlalchemy.org/en/latest/core/reflection.html#reflecting-views
from alchy.
Thanks for the info. Can you please provide an example of how to use the only parameter?
I only have 1 database and when I pass a dictionary to the method of the table names, I get a message stating that the mapping is not available in SQLALCHEMY_BINDS object.
Thanks,
G
from alchy.
What's your code that produces the error?
from alchy.
Thanks for the offer to help.
class Base(ModelBase):
# extend/override ModelBase if necessary
pass
Model = make_declarative_base(Base=Base)
config = {
'SQLALCHEMY_DATABASE_URI': conn_string,
}
reflect_tables = ['people']
db = Manager(config=config, Model=Model)
db.reflect(reflect_tables)
from alchy.
alchy.Manager.reflect
doesn't support the only
argument. That's something that's supported in SQLAlchemy's reflect() method but alchy doesn't curry that argument to it unfortunately. So you would need to extend Manager
:
- https://github.com/dgilland/alchy/blob/develop/alchy/manager.py#L279
- https://github.com/dgilland/alchy/blob/develop/alchy/manager.py#L249
from alchy.
Oh.. stupid on my part.. I misread your previous response. Thanks.
Greg
from alchy.
Related Issues (17)
- [bug] Incorrect reference to `model` module in `Manager` class
- Rename search config class attributes in ModelBase
- Add upsert() HOT 1
- Integrate ORM events into ModelBase HOT 2
- Migrate docs to sphinx and host on readthedocs.org HOT 1
- Add Python3 support
- Add ModelBase configuration option to force strict update by default HOT 1
- Consider implementing convention that certain model fields would be ignored when calling default to_dict(). HOT 2
- Add __getitem__ and __setitem__ proxies to getattr() and setattr() in ModelBase HOT 1
- Add iteritems() method to ModelBase HOT 1
- How to handle database restarts HOT 6
- Pep8 project renamed to pycodestyle HOT 2
- recursive loop HOT 3
- Will flask-sqlalchemy 3.0 make alchy unnecessary? HOT 2
- `ModelBase.__to_dict__` can infinitely recurse HOT 3
- Improper handling of session API HOT 4
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 alchy.