From 5285498d96466390bf657beafb3e6d187bad0f36 Mon Sep 17 00:00:00 2001 From: dancyy <33852694+dancyy@users.noreply.github.com> Date: Tue, 10 Oct 2023 00:22:58 -1000 Subject: [PATCH 1/5] Update src/README with instructions on using sqlite --- src/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/README.md b/src/README.md index b693e28..1a795b5 100644 --- a/src/README.md +++ b/src/README.md @@ -134,6 +134,21 @@ Follow these directions for easier database editing. - `npx prisma db push` - Run the application and confirm it works +# Prisma SQLite + +* Update the schema.prisma file to use the following provider +``` +provider = "sqlite" +``` +* Update the env file to specify the database file +``` +DATABASE_URL="file:./db.sqlite" +``` +* Run the following command to update the database +``` +npx prisma db push +``` + # Working with prisma When the data model changes, run the following to update your local database with the latest migrations From 2a09f4b914fc57b16b908b4eff0f17c9bad85332 Mon Sep 17 00:00:00 2001 From: dancyy <33852694+dancyy@users.noreply.github.com> Date: Fri, 13 Oct 2023 13:17:35 -1000 Subject: [PATCH 2/5] Add a note on why someone would want to use SQLite (#161) --- src/README.md | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/README.md b/src/README.md index 1a795b5..718c8eb 100644 --- a/src/README.md +++ b/src/README.md @@ -136,19 +136,24 @@ Follow these directions for easier database editing. # Prisma SQLite -* Update the schema.prisma file to use the following provider -``` -provider = "sqlite" -``` -* Update the env file to specify the database file -``` -DATABASE_URL="file:./db.sqlite" -``` -* Run the following command to update the database -``` +- Update the schema.prisma file to use the following provider + +`provider = "sqlite"` + +- Update the env file to specify the database file + +`DATABASE_URL="file:./db.sqlite"` + +- Run the following command to update the database + +```bash npx prisma db push ``` +> **_NOTE:_** SQLite is a [cross-platform](https://en.wikipedia.org/wiki/Cross-platform_software) database management system that provides a highly reliable, fast, and lightweight SQL database engine for everyone to use for any purpose. +> +>Learn more of why someone would want to use this free & open source library here: [When to use SQLite?](https://www.sqlite.org/whentouse.html) + # Working with prisma When the data model changes, run the following to update your local database with the latest migrations From 4c51abb772f37139eaab15e4c7c22289f2755fc9 Mon Sep 17 00:00:00 2001 From: dancyy <33852694+dancyy@users.noreply.github.com> Date: Mon, 16 Oct 2023 13:18:17 -1000 Subject: [PATCH 3/5] Update/edit src/README.md SQLite section (#161) resolves #161 --- src/README.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/README.md b/src/README.md index 718c8eb..b6b8e96 100644 --- a/src/README.md +++ b/src/README.md @@ -136,6 +136,12 @@ Follow these directions for easier database editing. # Prisma SQLite +## Why use SQLite? + +SQLite is a light-weight alternative to Microsoft SQL Server which may provide an easier setup solution for those running the project locally. + +> Note: The demographic questions will not populate because they are hard-coded in the SQL migrations. + - Update the schema.prisma file to use the following provider `provider = "sqlite"` @@ -150,10 +156,6 @@ Follow these directions for easier database editing. npx prisma db push ``` -> **_NOTE:_** SQLite is a [cross-platform](https://en.wikipedia.org/wiki/Cross-platform_software) database management system that provides a highly reliable, fast, and lightweight SQL database engine for everyone to use for any purpose. -> ->Learn more of why someone would want to use this free & open source library here: [When to use SQLite?](https://www.sqlite.org/whentouse.html) - # Working with prisma When the data model changes, run the following to update your local database with the latest migrations From 60b3e233034f0e7fa2018871ddf081968ce95a76 Mon Sep 17 00:00:00 2001 From: dancyy <33852694+dancyy@users.noreply.github.com> Date: Mon, 6 Nov 2023 16:38:22 -1000 Subject: [PATCH 4/5] Add more detailed install instructions for SQLite (#161) resolves (#160) --- src/README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 44 insertions(+), 4 deletions(-) diff --git a/src/README.md b/src/README.md index b6b8e96..080450f 100644 --- a/src/README.md +++ b/src/README.md @@ -24,7 +24,8 @@ docker exec -it hierr-sql-1 "bash" Enter the SQL Server CLI tool ```bash -/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "" + + ``` Create a new database and check that it was created @@ -136,11 +137,48 @@ Follow these directions for easier database editing. # Prisma SQLite -## Why use SQLite? +Why use SQLite? -SQLite is a light-weight alternative to Microsoft SQL Server which may provide an easier setup solution for those running the project locally. +SQLite is a light-weight alternative to Microsoft SQL Server that provides an easier setup solution for those running the project locally. -> Note: The demographic questions will not populate because they are hard-coded in the SQL migrations. +Getting started with SQLite + +Firstly, check if your machine already has SQLite. Many operating systems today come with SQLite pre-installed, but to verify run the following command: + +```bash +$sqlite3 +``` + +If already installed, a message similar to the following will display: + +```bash +SQLite version 3.37.2 2022-01-06 13:25:41 +Enter ".help" for usage hints. +Connected to a transient in-memory database. +Use ".open FILENAME" to reopen on a persistent database. +sqlite> +``` + +If not already installed, continue below: + + Windows Users + +- Checkout [SQLiteTutorial.net](https://www.sqlitetutorial.net/download-install-sqlite/) for a quick and simple Windows setup. + +Mac and Linux Users + +1. Go to the [SQLite download page](https://www.sqlite.org/download.html) and download sqlite-autoconf-*.tar.gz from the **Source Code** section. +2. Run the following commands: + +```bash +$tar xvfz sqlite-autoconf-3071502.tar.gz +$cd sqlite-autoconf-3071502 +$./configure --prefix=/usr/local +$make +$make install +``` + +Configuration - Update the schema.prisma file to use the following provider @@ -156,6 +194,8 @@ SQLite is a light-weight alternative to Microsoft SQL Server which may provide a npx prisma db push ``` +> Note: The demographic questions will not populate because they are hard-coded in the SQL migrations. + # Working with prisma When the data model changes, run the following to update your local database with the latest migrations From 9704d70f6452f688ab0abd58c100c6486ed44e33 Mon Sep 17 00:00:00 2001 From: dancyy <33852694+dancyy@users.noreply.github.com> Date: Tue, 7 Nov 2023 08:20:14 -1000 Subject: [PATCH 5/5] dancyy/add installation instructions for SQLite (#160) * Provide link to set up SQLite on windows * Provide instructions for Linux and Mac --- src/README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/README.md b/src/README.md index 080450f..65049e8 100644 --- a/src/README.md +++ b/src/README.md @@ -24,8 +24,7 @@ docker exec -it hierr-sql-1 "bash" Enter the SQL Server CLI tool ```bash - - +/opt/mssql-tools/bin/sqlcmd -S localhost -U SA -P "" ``` Create a new database and check that it was created