Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make pipeline compatible with all item types #17

Open
fkromer opened this issue Jun 7, 2022 · 2 comments
Open

Make pipeline compatible with all item types #17

fkromer opened this issue Jun 7, 2022 · 2 comments

Comments

@fkromer
Copy link

fkromer commented Jun 7, 2022

Introduce itemadapter into the pipeline to make the pipeline compatible with new item types pydanticobjects.

@IaroslavR
Copy link
Owner

Can you explain in more details your proposal?

@fkromer
Copy link
Author

fkromer commented Jun 8, 2022

The logic to generate SQL statements from items is specific to items of type dict. There are some other item types supported in addition. Not documented in the official docs is support for items of type pydantic objects. This is the most interesting type cause they are the base class for a lot of other interesting libraries out there (SQLModel, etc.). As a result one could use models (which are based on SQLModel) as items and get rid of a lot of duplicated code.

itemadapters are used to provide a uniform API to work with items independent of their underlying implementation. Means one could add itemadapters into the package and convert any item to an adapter before accessing/mutating it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants