You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Am I right to hope that the integration with sqlalchemy will bring a nice save-to-database feature to riko? I am currently looking what would be the best way to store things in db without breaking a pipeline, so that 'save-to-db' could be done seamless in different stages of the data pipeline.
Technically, you can already do something similar to that example with riko since it shares a similar data structure.
>>>fromriko.modules.fetchimportpipe>>>frommezaimportfntoolsasft>>>from .modelsimportTable# Table is a sqlalchemy.Model class# db is a sqlalchemy database instance>>>stream=pipe(conf={'url': 'https://news.ycombinator.com/rss'})
>>>fordatainft.chunk(stream, chunk_size):
... db.engine.execute(Table.__table__.insert(), data)
But you are correct in that this will "break" the pipeline since you are consuming the iterator. I do have future plans to have a pipe that outputs to sqlalchemy supported dbs. Maybe something like this:
There is a lot of overlap in functionality with the utils module and meza. Where possible, I should merge redundant functions and move new ones.
The text was updated successfully, but these errors were encountered: