Skip to content

Conversation

@quiloos39
Copy link
Contributor

What does it do?

Fixes the error: knex: Required configuration option 'client' is missing. error, When using SQLite as database and mentioned dependency doesn't exist.

Why is it needed?

I noticed that for some starters/templates. If the developer wants to switch back to the SQLite database and the dependency I mentioned is not available, it will return with an error message saying the client doesn't exist.

Related issue(s)/PR(s)

None

@strapi-cla
Copy link

strapi-cla commented Sep 8, 2022

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


quiloos39 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@vercel
Copy link

vercel bot commented Sep 8, 2022

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

Name Status Preview Updated
documentation ✅ Ready (Inspect) Visit Preview Sep 20, 2022 at 6:40AM (UTC)

@quiloos39
Copy link
Contributor Author

It wasn't mentioned in the documentation that SQLite depends on better-sqlite3.

Copy link
Contributor

@stb13579 stb13579 left a comment

Choose a reason for hiding this comment

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

Hello @quiloos39. Thank you for your contribution. I have made a few suggestions to improve the content. Let me know what you think.

},
});
```

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add the following code for TypeScript as well (using the code-group/code block like above)?

import path from 'path';

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

@stb13579 stb13579 added this to the 4.3.9 milestone Sep 19, 2022
quiloos39 and others added 2 commits September 20, 2022 09:35
…ons/databases/sqlite.md

Co-authored-by: Shaun Brown  <97027841+StrapiShaun@users.noreply.github.com>
…ons/databases/sqlite.md

Co-authored-by: Shaun Brown  <97027841+StrapiShaun@users.noreply.github.com>
@stb13579
Copy link
Contributor

Hello, @quiloos39 could you also sign the CLA so I can merge your contribution? Thanks!

@quiloos39
Copy link
Contributor Author

Hello, @quiloos39 could you also sign the CLA so I can merge your contribution? Thanks!

Hello, I already accepted CLA i am not sure why it's not updated here.

@stb13579 stb13579 merged commit d9bd8c6 into strapi:main Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants