Skip to content

Commit

Permalink
Merge pull request #1118 from quiloos39/main
Browse files Browse the repository at this point in the history
add manual installation sqlite
  • Loading branch information
stb13579 authored Sep 21, 2022
2 parents f133aca + 0f0a6ca commit d9bd8c6
Showing 1 changed file with 36 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ canonicalUrl: https://docs.strapi.io/developer-docs/latest/setup-deployment-guid

SQLite is the default ([Quick Start](/developer-docs/latest/getting-started/quick-start.md)) and recommended database to quickly create an app locally.

## Install SQLite locally
## Install SQLite using starter

Simply use one of the following commands.
Use one of the following commands:

<code-group>

Expand All @@ -34,6 +34,40 @@ This will create a new project and launch it in the browser.
The [Quick Start Guide](/developer-docs/latest/getting-started/quick-start.md) is a complete step-by-step tutorial.
:::

## Install SQLite manually

In terminal, run the following command:

<code-group>

<code-block title="NPM">
```sh
npm install better-sqlite3
```
</code-block>

<code-block title="YARN">
```sh
yarn add better-sqlite3
```
</code-block>

</code-group>

Add the following to your `./config/database.js` file:

```js
module.exports = ({ env }) => ({
connection: {
client: 'sqlite',
connection: {
filename: path.join(__dirname, '..', env('DATABASE_FILENAME', '.tmp/data.db')),
},
useNullAsDefault: true,
},
});
```

## Other SQL Databases (PostgreSQL, MySQL)

Refer to the [configuration section](/developer-docs/latest/setup-deployment-guides/configurations/required/databases.md) for all supported options to setup Strapi with your SQL database.
Expand Down

0 comments on commit d9bd8c6

Please sign in to comment.