How to import data to Edge SQL

This guide explains how to import data into your database using Edge SQL Shell.

Requirements

  • Edge SQL Shell Installed: Ensure that you have the Edge SQL shell properly installed on your system.

  • Database Setup: You need to have a database created. To create a new database within Edge SQL using the Shell, use the command:

Terminal window
.create <database-name>

Importing Data with Edge SQL Shell

  1. Select a Edge SQL database.
Terminal window
.use database-name
  1. Import your file.
.import file <csv|xlsx> <file_path> <table_name>

To verify the creation of your table you can use:

Terminal window
.tables

Importing from an SQL File

To import data from an .sql file containing SQL INSERT commands, use the .read command within the Edge SQL Shell. This will execute the SQL statements contained in the file and populate your database with the specified data.

Terminal window
.read <file_name>