marcboeker / go-duckdb

go-duckdb provides a database/sql driver for the DuckDB database engine.
MIT License
646 stars 97 forks source link

docs: Support godoc examples for 'simple' and 'advanced' configurations, add GoDoc badge #247

Open dxh9845 opened 2 months ago

dxh9845 commented 2 months ago

This PR adds Godoc examples on how to use the Goduckdb driver. These examples will be rendered inline on the DuckDB GoDoc page.

Here's how the examples look when rendered locally:

image

I've also added the GoDoc badge that will link directly to the documentation.

Please let me know if this is ok!

marcboeker commented 1 month ago

@dxh9845 Thanks for your contribution. More examples is always a good idea. Do you think we can move them to the examples/ folder and convert the existing examples also to the specific Godoc format to have a common place and format for all examples?

dxh9845 commented 1 month ago

@marcboeker Up to you - although in this case, the examples will show up on the Go doc page at the root package, whereas if it was in the examples directory, they'd appear only on the godoc page for the examples package. Let me know which you prefer.

taniabogatsch commented 1 week ago

We can link to the godoc examples package in the DuckDB docs, and in the README.md. Then, we can add many different examples to the folder, and don't have to worry about cluttering the source folder with files.

Would that work @dxh9845?