Init Command
Initialize project structure
Usage
The init command creates the basic project structure needed to work with excel-to-sql. Run this in any directory where you want to manage your Excel imports.
excel-to-sql initWhat It Creates
The command creates a standardized directory structure with all necessary folders and an empty SQLite database.
my-project/
├── data/
│ └── database.db # SQLite database
├── config/
│ └── mappings.json # Type configurations
├── imports/ # Original Excel files
└── exports/ # Exported Excel filesExamples
Initialize in Current Directory
Run the command in your current working directory to create the project structure right where you are.
excel-to-sql initInitialize with Custom Location
Create and navigate to a new directory before initializing to keep your project organized in a specific location.
mkdir my-project
cd my-project
excel-to-sql initAfter Initialization
Once your project is initialized, you'll need to configure types and start importing data. Follow these two essential steps:
- Add a type configuration:
excel-to-sql config add --type products --table products --pk id- Import your Excel file:
excel-to-sql import --file products.xlsx --type productsDatabase
The data/database.db file is created automatically. It contains:
- Your data tables
- Import history metadata
- Quality analysis data
Important: Don't delete the data/database.db file unless you want to lose all imported data.
Configuration File
The config/mappings.json file is where you define how your Excel files map to database tables. This file can be edited manually with a text editor or managed programmatically using the config command.
See Also
- config command - Manage configurations
- import command - Import data
- project structure - File organization