Skip to content

Commit

Permalink
Update src/README with instructions on using sqlite (#161)
Browse files Browse the repository at this point in the history
* Update src/README with instructions on using sqlite

* Add a note on why someone would want to use SQLite (#161)

* Update/edit src/README.md SQLite section (#161)

resolves #161

* Add more detailed install instructions for SQLite (#161)

resolves (#160)

* dancyy/add installation instructions for SQLite (#160)

* Provide link to set up SQLite on windows

* Provide instructions for Linux and Mac

---------

Co-authored-by: avenmia <[email protected]>
  • Loading branch information
dancyy and avenmia authored Dec 22, 2023
1 parent b0a55a4 commit c38223c
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,67 @@ Follow these directions for easier database editing.
- `npx prisma db push`
- Run the application and confirm it works

# Prisma SQLite

Why use SQLite?

SQLite is a light-weight alternative to Microsoft SQL Server that provides an easier setup solution for those running the project locally.

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

`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: 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
Expand Down

1 comment on commit c38223c

@vercel
Copy link

@vercel vercel bot commented on c38223c Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

hierr – ./

hierr.vercel.app
hierr-git-main-codeforhawaii.vercel.app
hierr-codeforhawaii.vercel.app

Please sign in to comment.