Documentation: Add executable code examples #552
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there,
instead of only nurturing the cratedb-examples » by-language folder with executable and sensible code examples, which demonstrate and explore specific areas around communicating with CrateDB efficiently, I think it is also valuable to maintain corresponding
examples
folders within the repositories itself, because this is where developers very often will look for, just because, well, runnable code examples are just so incredibly useful, and where else should I expect to find them? 1In this spirit, this patch is adding two code example from my gists collection, sqlalchemy_efficient_inserts.py and cratedb_pandas_insert.py, which I think make sense to be added here. I don't think they necessarily have to be tested automatically, but sure it will be nice to have, so if you think they should be tested, I am sure we will find a way to add them to the test suite without too much obstruction on a subsequent iteration.
With kind regards,
Andreas.
P.S.: This patch is here to set the stage for a subsequent one, which refactors the performance-optimized
insert_bulk
function into the package itself, in order to be able to reuse it in downstream software, notebooks and tutorials more easily./cc @marijaselakovic, @hammerhead, @hlcianfagna, @proddata, @WalBeh
Footnotes
I found this has not been much of a guideline at CrateDB's auxilliary repositories yet, so I started that recently at CrateDB PDO driver » Examples. ↩