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

Add info re: creating persistent db files #193

Merged
merged 4 commits into from
Apr 7, 2022

Conversation

dnlmc
Copy link
Contributor

@dnlmc dnlmc commented Mar 26, 2022

Adding some notes about creating new persistent db files. (following this discord convo)

Wasn't sure where was the best place for the info so added blurbs based on existing verbiage to:

  • docs/data/overview.md
  • docs/api/python.md
  • docs/api/r.md
  • docs/api/rust.md

Might also want to create a page or reference within guides/

@dnlmc dnlmc changed the title Add info re: creating persistent files Add info re: creating persistent db files Mar 26, 2022
Copy link
Collaborator

@Mytherin Mytherin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes! Looks good, minor comment:

@@ -2,7 +2,11 @@
layout: docu
title: Importing Data
---
The first step to using a database system is to insert data into that system. DuckDB provides several data ingestion methods that allow you to easily and efficiently fill up the database. In this section, we provide an overview of these methods so you can select which one is correct for you.
<!-- not sure if this section should be abstracted into its own page, or where it would be best placed, feel free to move -->
### Create a Connection (in-memory or persistant file)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As mentioned in the comment this feels out of place on the data import overview. A separate "Connect" page would make more sense (or perhaps just leave it out for now).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mytherin that makes sense. These updates were a result of me searching the documentation for confirmation on how to create persistent db files, & not finding anything. Maybe a "Connect & persist a database" section would make sense?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A Connect section would be fine, although the problem with that is that this is different for every single client. It could contain links to the pages of different clients, perhaps?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mytherin yea, I included updates in the Client APIs section for some specific clients where I could infer the proper approach (R, Python, Rust). Those are also part of this PR.

But wasn't sure where to put this generic instruction (which also refers & links to the API docs section for client-specific usage). And wasn't sure if it was worth its own whole page. There also seems to be some redundancy between the Guides & Documentation sections, so wasn't sure where is best:
Screen Shot 2022-03-29 at 4 21 31 PM

As a new user, I was simply looking for info on creating & persisting database files, & could find no mentions in the docs. So my suggestion again would be something like an explicit Connect & persist a database section in either Guides or Documentation, but will defer to the team.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But wasn't sure where to put this generic instruction (which also refers & links to the API docs section for client-specific usage). And wasn't sure if it was worth its own whole page. There also seems to be some redundancy between the Guides & Documentation sections, so wasn't sure where is best:

The Guides are meant as quick guides to accomplish specific goals, whereas the documentation (which should perhaps be renamed to Reference) is meant as a comprehensive reference that describes all available options. The guides serve as a starting point that point to the documentation section.

As a new user, I was simply looking for info on creating & persisting database files, & could find no mentions in the docs. So my suggestion again would be something like an explicit Connect & persist a database section in either Guides or Documentation, but will defer to the team.

The problem is that there is no generic way of connecting to and persisting a database. How to do this depends on which client you are using. Perhaps for now it is better to just leave this bit out, and leave the information only in the specific client API sections.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Mytherin Gotcha.

Would something like this work as a generic placeholder for folks like me specifically looking for this info?

Connect or Create a DB

To use DuckDB, you must first create a connection to a database. This process varies by client (see API docs for client-specific usage). Most Client APIs take a parameter pointing to a database file to read and write from (the file extension may be anything, e.g. .db, .duckdb, etc.). If the database file does not exist, it will be created. The special value :memory: can typically be used to create an in-memory database where no data is persisted to disk (i.e. all data is lost when you exit the process). Again, see API docs for client-specific details.

Otherwise I can just remove this generic info from the PR & only keep the added details in the Client APIs section.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, perhaps only include the link once:

Connect or Create a DB

To use DuckDB, you must first create a connection to a database. The exact process varies by client. Most clients take a parameter pointing to a database file to read and write from (the file extension may be anything, e.g. .db, .duckdb, etc.). If the database file does not exist, it will be created. The special value :memory: can be used to create an in-memory database where no data is persisted to disk (i.e. all data is lost when you exit the process). See the API docs for client-specific details.

Could you then add a Connect page at the top of the Documentation that includes this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've got that change ready to commit!

Do I need to do anything other than add a connect.md file to the docs/ folder? (& undo the change to overview.md)

e.g. any changes to _data/menu_docs_* to add the page to the sidebar menu?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you need to change the menu_docs as well when creating a new page.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have committed the changes:

@Mytherin Mytherin merged commit 77e81f6 into duckdb:master Apr 7, 2022
@Mytherin
Copy link
Collaborator

Mytherin commented Apr 7, 2022

Thanks!

@dnlmc
Copy link
Contributor Author

dnlmc commented Apr 7, 2022

@Mytherin thanks for all your work on this project! love what you're doing here

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

Successfully merging this pull request may close these issues.

2 participants