Skip to content

Tech spike: Evaluate the changes needed to adapt Serverpod to support SQLite and other databases #4721

Closed

Description

@marcelomendoncasoares

Problem to Solve

Serverpod currently rely only on Postgres, but support for other databases has been extensively requested in the past (specially SQLite and MySQL/MariaDB, as shown in below references). Internally, Serverpod is mostly structured to support other databases, with several database concepts abstracted in serverpod/lib/src/database/concepts. But some parts of the implementation ended up scattered through the codebase, making it hard for contributors unfamiliar with the codebase to add another engine.

This issue aims to document the changes needed to support other database engines and serve as a guide for future implementations or community contributions.

Proposal

Analyze the Serverpod codebase to map the changes needed to implement other database engines. The main packages involved are:

  • packages/serverpod: Implementation of the database concepts, adapter, connection and analyzer.
  • packages/serverpod_shared: Definition of the database config that is specified on the config/*.yaml files.
  • tools/serverpod_cli: Dialect-specific SQL generation for migrations.

This issue should result in a guide on the changes required to add a new database engine.

Use Case

Allow extension of Serverpod to support other database engines in the future.

Alternatives

Continue using only Postgres.

Additional context

This work begun as part of #4564. Since the decoupling between the Serverpod version and CLI will require moving part of the generator from the CLI to another package, this should be done in a way that gets the codebase closer to support other engines - instead of making it even harder.

Related issues and discussions:

How experienced are you with this library?

None

Are you interested in working on a PR for this?

  • I want to work on this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area: databaseenhancement

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions