Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ The beta version of Strapi 5 is not meant to be used in production yet.

- [MySQL v5 is not supported anymore](/dev-docs/migration/v4-to-v5/breaking-changes/mysql5-unsupported)
- [Database identifiers can't be longer than 55 characters](/dev-docs/migration/v4-to-v5/breaking-changes/database-identifiers-shortened)
- [Only the `better-sqlite3` package is supported for the sqlite client](/dev-docs/migration/v4-to-v5/breaking-changes/only-better-sqlite3-for-sqlite)

## Plugins, plugins configuration, and plugins development

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
title: Only the `better-sqlite3` package is supported for the sqlite client
description: In Strapi 5,
sidebar_label: Only better-sqlite3 for sqlite
displayed_sidebar: devDocsMigrationV5Sidebar
unlisted: true
tags:
- breaking changes
---

import Intro from '/docs/snippets/breaking-change-page-intro.md'
import MigrationIntro from '/docs/snippets/breaking-change-page-migration-intro.md'
import NoPlugins from '/docs/snippets/breaking-change-not-affecting-plugins.md'

# Only the `better-sqlite3` package is supported for the sqlite client

Strapi 5 can only use the `better-sqlite3` package for SQLite databases, and the `client` value for it must be set to `sqlite`

<Intro />

<NoPlugins/>

## Breaking change description

<SideBySideContainer>

<SideBySideColumn>

**In Strapi v4**

The database configuration `client` option for SQLite databases accepts several values such as `sqlite3`, `vscode/sqlite3`, `sqlite-legacy`, and `better-sqlite3`.

</SideBySideColumn>

<SideBySideColumn>

**In Strapi 5**

The database configuration `client` option for SQLite database only accepts `sqlite`.

</SideBySideColumn>

</SideBySideContainer>

## Migration

<MigrationIntro />

### Notes

Strapi 5 uses the `better-sqlite3` package for SQLite databases under the hood. Knex rewrites the `sqlite` option as `better-sqlite3`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Strapi 5 uses the `better-sqlite3` package for SQLite databases under the hood. Knex rewrites the `sqlite` option as `better-sqlite3`.
Strapi 5 uses the `better-sqlite3` package for SQLite databases under the hood and rewrites the `sqlite` option as `better-sqlite3` for Knex.

### Manual procedure

No manual migration should be required as codemods from the [upgrade tool](/dev-docs/upgrade-tool) will handle this change.

In case you want to manually migrate, run the following commands in the terminal:

1. Run `yarn remove sqlite3` to remove the sqlite 3 package.
2. Run `yarn add better-sqlite3` to install the `better-sqlite3` package.
3 changes: 2 additions & 1 deletion docusaurus/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -1152,7 +1152,8 @@ const sidebars = {
},
items: [
'dev-docs/migration/v4-to-v5/breaking-changes/mysql5-unsupported',
'dev-docs/migration/v4-to-v5/breaking-changes/database-identifiers-shortened'
'dev-docs/migration/v4-to-v5/breaking-changes/database-identifiers-shortened',
'dev-docs/migration/v4-to-v5/breaking-changes/only-better-sqlite3-for-sqlite',
]
},
{
Expand Down