Make database feature optional?

The last days I’ve been experimenting with the database class and read about alternative database classes.

For most sites the database class is not used. It’s not even used in the panel. Kirby does not need it in order to work. It’s not something that is tight bundled with Kirby but some extra thing that hangs on Kirby as a sideload.

Maybe break it out and have it as a plugin instead?

I mean no disrespect to the database class, just thinking modular and keeping things tight.

What do you think about that?

It’s already optional. Just because the files are there doesn’t mean that it adds complexity. The files are only autoloaded if they are needed. :slight_smile:
We will keep it as part of the Toolkit as the Toolkit is just a collection of useful classes. Otherwise we would have to create a lot of modules and that would make it complex.

2 Likes

Right on, you better choose your words carefully around the database class! It’s known to be easily offended and shows no mercy to the haters.

All hail to the database class!

7 Likes

@diondiondion’s comment made my day :slight_smile:

There’s a german saying. “It doesn’t eat any bread” for things which are not really adding any kind of burden or overhead, so you can just keep them.

The Database Class adds around 34 KB of code and as Lukas pointed out, it’s only loaded if you call it.

3 Likes

The idea of this topic came up because I was thinking about using another database class for really complex queries and that would leave me with 2 database classes, where the built in one would not be needed.

@lukasbestle

Otherwise we would have to create a lot of modules and that would make it complex.

Alright, less complexity is better. :slight_smile:

@diondiondion

Right on, you better choose your words carefully around the database class!

I really hope I did not offend the class or any real person. That’s why I added “I mean no disrespect to the database class”… but I see now that I forgot to add smilies so here they are… :slight_smile::grinning::grin:

@bastianallgeier

It doesn’t eat any bread

Nice! Then I don’t need to worry about it. :bread: :slight_smile: