Skip to content

Provide custom drivers support and split different databases into sub-packages #2479

Open

Description

@pleerock
  1. Provide a way to create custom driver more easily
  2. 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.

adding @daniel-lang

Activity

  1. added this to the 0.3.0 milestone on Jul 7, 2018
  2. cuibonobo commented on Jul 7, 2018

    @cuibonobo
    Contributor

    This is an excellent idea.

  3. stevefan1999-personal commented on Jul 9, 2018

    @stevefan1999-personal

    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?

  4. Kononnable commented on Sep 12, 2018

    @Kononnable
    Contributor

    If we choose splitting drivers with @typeorm/core (#2.1) we should also decide about splitting the codebase:

    1. keep single git repository for core and drivers
      • complicated build/publish
      • one repository for commits
    2. 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.

  5. daniel-lang commented on Oct 6, 2018

    @daniel-lang
    Contributor

    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.

  6. modified the milestones: 0.3.0, on Dec 17, 2018
  7. annymosse commented on Mar 21, 2020

    @annymosse

    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.

  8. stephanoparaskeva commented on Apr 26, 2020

    @stephanoparaskeva

    Does typeorm support porsager/postgres?

  9. ctrlplusb commented on May 20, 2020

    @ctrlplusb

    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.

  10. chamerling commented on Oct 12, 2020

    @chamerling

    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

  11. ajmas commented on Oct 7, 2021

    @ajmas

    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.

  12. removed this from the 0.4.0 milestone on Nov 10, 2021
  13. angelxmoreno commented on May 2, 2024

    @angelxmoreno

    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?

  14. alexey-sh commented on Jun 17, 2024

    @alexey-sh

    @angelxmoreno I guess you have almost 0 chance to see the desired docs

  15. jcuenod commented on Dec 20, 2024

    @jcuenod

    Like @angelxmoreno, I also came here hoping to use typeorm in Tauri with its sqlite plugin.

  16. robingenz commented on Jun 24, 2025

    @robingenz

    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.

  17. angelxmoreno commented on Jun 28, 2025

    @angelxmoreno

    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.

  18. flowluap commented on Sep 10, 2025

    @flowluap

    Would love to add a sqlanywhere driver...

  19. average-web-dev commented on May 11, 2026

    @average-web-dev

    Would love to add a sqlanywhere driver...

    Same here—I have to work with an SAP ASE 15.7 database, and there's simply no alternative to using a dedicated driver.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions