learn-springboot-restapi-sq.../data
2023-12-19 11:19:08 +08:00
..
.gitignore First commit with code 2023-12-19 11:19:08 +08:00
.gitkeep First commit with code 2023-12-19 11:19:08 +08:00
README.md First commit with code 2023-12-19 11:19:08 +08:00

Readme for this data folder

This folder contains:

  1. The runtime database (SQLite) files - *.sqlite3
  2. The SQL scripts for database maintenance:

Database Maintenance Scripts

File Description
schema.sql Database schema
create-sample-data.sql Insert sample rows to the users table

To run the sql script with SQLite3:

cat <sql script file> | sqlite3 <database file>

Init the database

NOTE: The init script will remove all data. Please backup the data before performing the follow steps.

cat ../src/main/resources/sqlite/schema.sql | sqlite3 mainapp.sqlite3

Create sample data

cat ../src/main/resources/sqlite/create-sample-data.sql | sqlite3 mainapp.sqlite3