excel-to-sql

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 init

What 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 files

Examples

Initialize in Current Directory

Run the command in your current working directory to create the project structure right where you are.

excel-to-sql init

Initialize 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 init

After Initialization

Once your project is initialized, you'll need to configure types and start importing data. Follow these two essential steps:

  1. Add a type configuration:
excel-to-sql config add --type products --table products --pk id
  1. Import your Excel file:
excel-to-sql import --file products.xlsx --type products

Database

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

On this page