Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(medusa): Remove sqlite support #4026

Merged
merged 12 commits into from
May 17, 2023
Merged

Conversation

olivermrbl
Copy link
Contributor

@olivermrbl olivermrbl commented May 5, 2023

What
Remove support for SQLite

Why
SQLite support was initially added to reduce friction for developers looking to try out Medusa. It runs on most operating systems without any installation, which means you'll be able to create and start a Medusa starter without configuration.

Though, as we've added features that use more advanced database concepts, we've seen that SQLite is now causing more harm than good. It still allows developers to get a server up and running very quickly, but as soon as you start playing around with our admin system or the storefront starter, you'll experience issues caused by the limitations of SQLite. The issues are primarily centered around transaction management. A concept used extensively in our core and poorly supported by SQLite.

We've concluded that these issues are causing too many headaches for our users and require too much assistance from our side for it to be worth it. Therefore, we are removing SQLite from our core and will only support Postgres for the time being.

@changeset-bot
Copy link

changeset-bot bot commented May 5, 2023

🦋 Changeset detected

Latest commit: a354cde

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 22 packages
Name Type
@medusajs/medusa-cli Patch
medusa-plugin-contentful Patch
@medusajs/medusa Patch
@medusajs/utils Patch
@medusajs/admin-ui Patch
@medusajs/admin Patch
@medusajs/medusa-js Patch
medusa-payment-paypal Patch
medusa-payment-stripe Patch
medusa-plugin-meilisearch Patch
medusa-plugin-restock-notification Patch
medusa-react Patch
@medusajs/medusa-oas-cli Patch
@medusajs/event-bus-local Patch
@medusajs/event-bus-redis Patch
@medusajs/inventory Patch
medusa-plugin-algolia Patch
@medusajs/modules-sdk Patch
@medusajs/stock-location Patch
@medusajs/oas-github-ci Patch
@medusajs/cache-inmemory Patch
@medusajs/cache-redis Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented May 5, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
medusa-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 17, 2023 9:39am

@olivermrbl
Copy link
Contributor Author

We will also need to remove all mention of sqlite in our documentation cc @shahednasser

@olivermrbl olivermrbl marked this pull request as ready for review May 7, 2023 10:24
@olivermrbl olivermrbl requested a review from a team as a code owner May 7, 2023 10:24
await dataSource.initialize()
} catch (err) {
// database name does not exist
if (err.code === "3D000") {
Copy link
Contributor Author

@olivermrbl olivermrbl May 7, 2023

Choose a reason for hiding this comment

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

comment: Hopefully, that'll reduce friction just a tiny bit

CleanShot 2023-05-07 at 15 05 09@2x

Copy link
Member

Choose a reason for hiding this comment

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

question: Should we always throw an error to prevent swallowing it?

@olivermrbl olivermrbl requested review from srindom and adrien2p May 8, 2023 08:22
try {
await dataSource.query(`select * from migrations`)
} catch (err) {
if (err.code === "42P01") {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

comment: Another one to reduce friction and make it easier to get started

Copy link
Member

Choose a reason for hiding this comment

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

Same question as the previous one

@olivermrbl olivermrbl force-pushed the feat/remove-sqlite-support branch from f5b0173 to 536db08 Compare May 8, 2023 12:36
@spacewalkingninja
Copy link

spacewalkingninja commented May 9, 2023

Yeah and there is no MySql//MariaDB support MAKING US USE 20 MB OF RAM FOR EVERY CONNECTION WE NEED TO MAKE!
This is unfair and very resource wasteful, not ecological at all.
All this because you want transactions and things.
Just insert and update things and stuff works like back when we were script kiddies that just used PHP and some CMS downloaded from the net.

@olivermrbl
Copy link
Contributor Author

/snapshot-this

@olivermrbl
Copy link
Contributor Author

@adrien2p will you give this is a review when time allows for it?

@github-actions
Copy link
Contributor

🚀 A snapshot release has been made for this PR

Test the snapshots by updating your package.json with the newly published versions:

yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]
yarn add @medusajs/[email protected]

Latest commit: 7963c16

@spacewalkingninja
Copy link

@olivermrbl YOU are ignoring my comment! It is a democratic opens source and here is open source opinion: sqlite support is a GOOD AND BVERY GOOD FEAT DO NOT REMOVE IT!

@olivermrbl olivermrbl requested review from riqwan and pKorsholm May 16, 2023 06:59
Copy link
Contributor

@pKorsholm pKorsholm left a comment

Choose a reason for hiding this comment

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

LGTM! Just have a question and a nit suggestion 😄

Copy link
Contributor

@riqwan riqwan left a comment

Choose a reason for hiding this comment

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

Looks good!

Should we also remove sqlite and better-sqlite from the main package.json?

@olivermrbl olivermrbl requested review from riqwan and pKorsholm May 16, 2023 10:08
@olivermrbl
Copy link
Contributor Author

Should we also remove sqlite and better-sqlite from the main package.json?

From where? I believe they are removed already

@olivermrbl
Copy link
Contributor Author

olivermrbl commented May 16, 2023

OU are ignoring my comment! It is a democratic opens source and here is open source opinion: sqlite support is a GOOD AND BVERY GOOD FEAT DO NOT REMOVE IT!

As you can read from the PR description, we've concluded that SQLite is causing more harm than good and will therefore be removed. It is virtually unusable even for the simplest cases, and we don't want to put in the effort to support it fully. We will soon be moving to a more ORM agnostic approach at which point, you'll be able to build support for it yourself.

Find a related comment here.

Copy link
Contributor

@riqwan riqwan left a comment

Choose a reason for hiding this comment

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

nvm about the package question, i might've looked at an outdated file.

Thanks for moving the categories seed in the process! <3

Copy link
Member

@adrien2p adrien2p left a comment

Choose a reason for hiding this comment

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

LGTM with comments

await dataSource.initialize()
} catch (err) {
// database name does not exist
if (err.code === "3D000") {
Copy link
Member

Choose a reason for hiding this comment

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

question: Should we always throw an error to prevent swallowing it?

try {
await dataSource.query(`select * from migrations`)
} catch (err) {
if (err.code === "42P01") {
Copy link
Member

Choose a reason for hiding this comment

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

Same question as the previous one

Copy link
Member

@adrien2p adrien2p left a comment

Choose a reason for hiding this comment

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

LGTM with comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants