hanami / cli

Hanami command line
MIT License
26 stars 24 forks source link

Generate db files in `hanami new` #147

Open timriley opened 1 month ago

timriley commented 1 month ago

Include these options will let you tailor the output:

--skip-db to skip DB setup --database=sqlite to use an sqlite database (the default) --database=postgres to use a postgres database --database=mysql to use a mysql database

cllns commented 2 weeks ago

How committed to postgres being the default database are you? SQLite is much simpler due to it being file-based, plus there's a growing movement of using SQLite in production so it's not setting people up for failure.

We can turn strict_tables on and generally optimize SQLite in other ways too https://github.com/rails/rails/pull/49349

timriley commented 2 weeks ago

@cllns Yeah, I'm happy to switch to SQLite as a default. It would make the first-run experience much simpler.

I don't personally have an appetite right now for figuring out all the ways we should tune SQLite for best performance for web-style apps. If you could help figure out a minimal set of things we could do there, that'd be very helpful. Otherwise, we can just live with the defaults and consider improvements in future releases.

cllns commented 2 weeks ago

Yea I'm definitely down to figure that out and set up some solid defaults.

FWIW, I think Hanami and SQLite in production may be a particularly good combination since Hanami is so fast and memory efficient. One big server can probably handle a ridiculous amount of traffic. Time will tell!