Add an option for specifying column names when inserting CSV data
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.2k
- Forks
- 172
- Avg merge
- 9m
- Merged PRs (30d)
- 1
Description
https://sqlite-utils.datasette.io/en/stable/cli.html#csv-files-without-a-header-row
The first row of any CSV or TSV file is expected to contain the names of the columns in that file.
If your file does not include this row, you can use the
--no-headersoption to specify that the tool should not use that fist row as headers.
If you do this, the table will be created with column names called
untitled_1anduntitled_2and so on. You can then rename them using thesqlite-utils transform ... --renamecommand.
It would be nice to be able to specify the column names when importing CSV/TSV without a header row, via an extra command line option.
(renaming a column of a large table can take a long time, which makes it an inconvenient workaround)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the CLI documentation section on CSV files without a header row and locate the command entry point that handles CSV/TSV imports. Define the option's expected column-name input and verify that importing a headerless file creates those names directly, without requiring a later rename.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sqlite
- Domain
- cli, databases
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100