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

Better defaults #11

Closed
kevinlang opened this issue Mar 18, 2021 · 1 comment
Closed

Better defaults #11

kevinlang opened this issue Mar 18, 2021 · 1 comment

Comments

@kevinlang
Copy link
Member

Right now Exqlite has some "opinionated" recommendations like defaulting FK to on, but defers to the application developer to configure things like journal_mode. I think that, at least in the Ecto adapter, that opinionated approach should be extended to the other options, like journal_mode. This is from my experience reading forums and issues around SQLite where novice developers do not understand that they need to set busy_timeout and journal_mode to a better defualt value. This is also reflected in the sentiment in the SQLite forums and maintainers where these options are lauded and only not turned on because of backwards compatability concerns.

What do you think @warmwaffles ?

If so, the question is whether these more sane defaults should be shared across both Exqlite and this adapter. I can see the appeal of the Exqlite adapter being more conservative and less prescriptive, as those who need to use the driver directly probably know what they are doing and would expect the defaults to be nearer the SQLite defaults.

@warmwaffles
Copy link
Member

I think it would be okay to set the defaults to

  journal_mode: :wal,
  cache_size: -64000,
  temp_store: :memory,
  pool_size: 5,

As a good starting point. That's what I've been using in my personal projects and it seems to hold well. Probably need more extensive documentation and links to discussions around the configuration recommendations.

I just set the defaults that sqlite3 has by default.

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

No branches or pull requests

2 participants