Support other database backends #167

Open
opened 2022-05-07 13:17:20 +02:00 by Jef Roosens · 5 comments

Vlib has support for sqlite, postgresql & mysql/mariadb. If we could re-write the code to choose which database type to use, the ORM would allow us to choose one over the other.

Vlib has support for sqlite, postgresql & mysql/mariadb. If we could re-write the code to choose which database type to use, the ORM would allow us to choose one over the other.
Jef Roosens added the
enhancement
label 2022-05-07 13:17:20 +02:00

The ORM is currently not complete enough to allow for this.

The ORM is currently not complete enough to allow for this.

I think this could be accomplished by not using the ORM syntax at all. Instead, all database operations could rely on the orm.Connection interface. Then the type of the database connection could be just orm.Connection, allowing multiple database backends!

Of course, this still leaves the problem of migrations. We'd have to write migrations for every database backend that we wish to support.

I think this could be accomplished by not using the ORM syntax at all. Instead, all database operations could rely on the `orm.Connection` interface. Then the type of the database connection could be just `orm.Connection`, allowing multiple database backends! Of course, this still leaves the problem of migrations. We'd have to write migrations for every database backend that we wish to support.

this PR could make this simpler, as it would allow us to use a generic orm.Connection object for ORM operations, leaving only the problem of custom migrations.

[this PR](https://github.com/vlang/v/pull/16076) could make this simpler, as it would allow us to use a generic `orm.Connection` object for ORM operations, leaving only the problem of custom migrations.
Jef Roosens added a new dependency 2022-11-02 08:21:51 +01:00

The above PR has not been merged in the V 0.3.2 release, so we'll most likely have to wait until V 0.3.3 to fully implement this. However, we can already pave the way by implementing #283.

The above PR has not been merged in the V 0.3.2 release, so we'll most likely have to wait until V 0.3.3 to fully implement this. However, we can already pave the way by implementing #283.
Jef Roosens added the
V
label 2022-11-02 08:34:17 +01:00

The PR didn't make it into V 0.3.3 🤷‍♂️

The PR didn't make it into V 0.3.3 🤷‍♂️
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Depends on
Reference: vieter-v/vieter#167
There is no content yet.