You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Provide custom drivers support and split different databases into sub-packages #2479
Think if we can split different drivers into their own packages, e.g. @typeorm/mysql, @typeorm/postgres, @typeorm/sqlite, @typeorm/sqljs-node, @typeorm/sqljs-browser
2.1. Think if we need a @typeorm/core
The reason behind #1 is not to have new drivers like #2240 but instead have a flexible mechanizm to allow users to create their own drivers.
The reasons behind #2 are numerous. It will allow us to make a specific functionalities in their own packages, pack their own drivers with the packages, etc.
Think if we need a @typeorm/core
some implementation detail, let's say do we want to have Entity inside core or inside each driver. If we do it inside core then it will be possible to use those entities across different drivers, if we do it inside their own packages then we'll be able to "give" additional functionality.
We already had multiple discussions before, I'll need to find all related issues and link them here.
For the lulz, just derive the drivers as dependencies and inject them on-demand with TypeDI🙃.
However, the GCDs of the drivers aren't...so well compatible to each other, for example, mongo has another set of API, and I think so the interface is hard to define eh?
If we choose splitting drivers with @typeorm/core (#2.1) we should also decide about splitting the codebase:
keep single git repository for core and drivers
complicated build/publish
one repository for commits
separate git repositories for npm packages
adding new driver is just cloning repository and making necessary changes
some logic for CI tests - commit to core should run tests for all drivers(shouldn't be to hard to write)
less complicated file structure
We should also think about running automated CI tests for example projects for every typeorm build(even if we don't choose #2). It would help to prevent situations like #2531 and make sure we keep examples up-to-date.
There is also a question if CLI should be in a separated package.
Having separate repos for the different drivers also adds complexity/trouble with issues. Even right now, some issues are reported multiple times (in an example and in the main repo).
hi @daniel-lang for "... some issues are reported multiple times (in an example and in the main)" , i would like to suggest to create an issue generator on your website which provide options and guide that help the devs to post them generated issue by following the provided questions and options.
Being able to extend typeorm by adding new drivers without having to fork the project is one of the main missing point today. Are there some plans for this? I see a lot of issues related to this and no clear responses nor plans.
Thanks a lot
Reacted by Patrick Moriarty, Constantin Titarenko, Paya and Roger Far
For the drivers already part of the library, could they not be included using dynamic imports? It would mean the initialisation phase would need to be asynchronous, but it would help avoid Vue projects, for example, being told they need a react dependency.
I would love to publish my own TypeORM driver for a libsql Capacitor plugin. Are there any docs for this?
In my opinion, this issue is of fundamental importance. If the community could develop its own drivers, this would also mean less work for the typeorm maintainers and more time for key improvements.
I would love to publish my own TypeORM driver for a libsql Capacitor plugin. Are there any docs for this?
In my opinion, this issue is of fundamental importance. If the community could develop its own drivers, this would also mean less work for the typeorm maintainers and more time for key improvements.
Agreed. Was chatting it up with a dev on the discord channel and we concluded that there are prerequisites to move forward on this. Basically, some work has to be done first before this feature becomes available. I'm under the impression that identifying these in detail would help push this feature forward.
Activity
cuibonobo commentedon Jul 7, 2018
This is an excellent idea.
stevefan1999-personal commentedon Jul 9, 2018
For the lulz, just derive the drivers as dependencies and inject them on-demand with TypeDI🙃.
However, the GCDs of the drivers aren't...so well compatible to each other, for example, mongo has another set of API, and I think so the interface is hard to define eh?
Kononnable commentedon Sep 10, 2018
Some of related issues:
Kononnable commentedon Sep 12, 2018
If we choose splitting drivers with
@typeorm/core(#2.1) we should also decide about splitting the codebase:We should also think about running automated CI tests for example projects for every typeorm build(even if we don't choose
#2). It would help to prevent situations like #2531 and make sure we keep examples up-to-date.There is also a question if CLI should be in a separated package.
daniel-lang commentedon Oct 6, 2018
Having separate repos for the different drivers also adds complexity/trouble with issues. Even right now, some issues are reported multiple times (in an example and in the main repo).
But I agree, we need to split up the codebase.
annymosse commentedon Mar 21, 2020
hi @daniel-lang for "... some issues are reported multiple times (in an example and in the main)" , i would like to suggest to create an issue generator on your website which provide options and guide that help the devs to post them generated issue by following the provided questions and options.
for example when you try to create a new issue on Vuetify project they redirect you to the following link https://github.com/vuetifyjs/vuetify/issues/new/choose then when you click on open icon it redirect you again into them issue generator https://issues.vuetifyjs.com/ you can visit these above links to get a full idea.
stephanoparaskeva commentedon Apr 26, 2020
Does typeorm support porsager/postgres?
ctrlplusb commentedon May 20, 2020
I'd strongly suggest using a Lerna based monorepo strategy coupled with Yarn workspaces for this.
It'll save you massive pain in managing a development, versioning, and publishing strategy for your packages. I speak from experience here.
Some widely adopted tools have had great success with this approach - see Babel and Jest for example.
I'd be happy to advise/contribute where I can.
chamerling commentedon Oct 12, 2020
Hello,
Being able to extend typeorm by adding new drivers without having to fork the project is one of the main missing point today. Are there some plans for this? I see a lot of issues related to this and no clear responses nor plans.
Thanks a lot
ajmas commentedon Oct 7, 2021
For the drivers already part of the library, could they not be included using dynamic imports? It would mean the initialisation phase would need to be asynchronous, but it would help avoid Vue projects, for example, being told they need a react dependency.
angelxmoreno commentedon May 2, 2024
Whatever happend to this work? I'd like to create a custom driver for TauriSql. Could we atleast get the steps to creating a custom driver documented?
alexey-sh commentedon Jun 17, 2024
@angelxmoreno I guess you have almost 0 chance to see the desired docs
jcuenod commentedon Dec 20, 2024
Like @angelxmoreno, I also came here hoping to use typeorm in Tauri with its sqlite plugin.
robingenz commentedon Jun 24, 2025
I would love to publish my own TypeORM driver for a libsql Capacitor plugin. Are there any docs for this?
In my opinion, this issue is of fundamental importance. If the community could develop its own drivers, this would also mean less work for the typeorm maintainers and more time for key improvements.
angelxmoreno commentedon Jun 28, 2025
Agreed. Was chatting it up with a dev on the discord channel and we concluded that there are prerequisites to move forward on this. Basically, some work has to be done first before this feature becomes available. I'm under the impression that identifying these in detail would help push this feature forward.
flowluap commentedon Sep 10, 2025
Would love to add a sqlanywhere driver...
average-web-dev commentedon May 11, 2026
Same here—I have to work with an SAP ASE 15.7 database, and there's simply no alternative to using a dedicated driver.