Skip to content

Plans to support MSSQL? #593

Open
Open

Description

@ravensorb

Curious if there are plans to support MSSQL, especially now that it runs on linux. This would be a huge value add.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

Activity

  1. wzrdtales commented on Oct 30, 2018

    @wzrdtales
    Member

    @ravensorb No, none. But, I designed db-migrate in the late versions to provide the most possible freedom to the community. Drivers are external, so everyone can just freely write their own driver. So if you're in a big need for it. It is not too hard to write a driver for old standard SQL databases like MSSQL is.

    I dedicated a section in the docs for this:
    https://db-migrate.readthedocs.io/en/latest/Developers/contributing/#creating-your-own-driver

    You can also look in the organisation at the other drivers for examples: https://github.com/db-migrate or even search in npm for community drivers. A driver always needs to start with the prefix db-migrate- so they're easy to find.

    I will flag this as a feature request and with help wanted, since I wont invest work here. You could however also put a bounty on this issue via https://www.bountysource.com/, if the invested time gets payed I will also dedicate some time for this request or someone from the community, but I don't have enough time to spend them on all community request, also I would love to do so.

    Feel free to reach out should you have any additional questions.

  2. christiaanwesterbeek commented on Apr 13, 2019

    @christiaanwesterbeek

    @ravensorb @wzrdtales I've built one today. Here it is: https://github.com/devotis/db-migrate-mssql

    I started from a fork of https://github.com/db-migrate/pg . Took me about half a day to build it, and it's working. Without transactions for now. I'm sure there's room for improvement though. If you want to try, run: yarn add @devotis/db-migrate-mssql

    I've not adapted the tests from pg to mssql yet, so no guarantees, but I'm able to migrate up and down. I tried only runSql thus far.

  3. christiaanwesterbeek commented on Apr 14, 2019

    @christiaanwesterbeek

    @wzrdtales Running into a problem here. Somebody already published db-migrate-mssql, but they did half the job since it's not working. I redid it from a fork of pg and it's working, but since the name db-migrate-mssql is already published at npm, I had to scope-publish mine at @devotis/db-migrate-mssql. But now when I use the driver mssql to migrate, db-migrate is telling me:

    Error: No such driver found, please try to install it via npm install db-migrate-mssql or npm install -g db-migrate-mssql

    And that's correct, but the driver IS installed, just not under the conventionalized name. How about adding a repository configuration for that? Something like:

    {
      "prod": {
        "driver": "mssql",
        "repository": "@devotis/db-migrate-mssql",
        "user": {"ENV": "PRODUCTION_USERNAME"},
        "password": {"ENV": "PRODUCTION_PASSWORD"}
      },
    }
  4. christiaanwesterbeek commented on Apr 14, 2019

    @christiaanwesterbeek

    For the time being, you guys can add this to your package.json and than yarn/npm install:

    "db-migrate-mssql": "https://github.com/devotis/db-migrate-mssql",

    So, don't do yarn add @devotis/db-migrate-mssql for now, and if you already did, remove the line "@devotis/db-migrate-mssql": "1.0.1", from your pacakage.json

  5. wzrdtales commented on Jun 1, 2019

    @wzrdtales
    Member

    Hey, sry for the delay. Today is again some Open Source Time free for me.

    I will add support for name scoped packages. Have nothing to argue against that in general.

  6. wzrdtales commented on Jun 1, 2019

    @wzrdtales
    Member

    @christiaanwesterbeek Btw. always try to reach out the npm support and report them an inactive package. Of course try to contact the mssql package owner first and ask him to transfer it to you. Most people will gladly do that if their package is not being maintained anyways.

  7. ryd0rz commented on Sep 30, 2019

    @ryd0rz

    Hi, I work for a company named Level Up Development, and we published the db-migrate-mssql to allow db-migrate MSSQL support for several internal projects we are currently developing.

    @christiaanwesterbeek - If you'd like to be added to our git repository as a collaborator - we'd be happy to add you, to help further the support for db-migrate's compatibility with MSSQL.

    Reason we chose to extend support to MSSQL is because we believe DB-migrate is the first npm package to have written a database migration tool the right way.

    Currently we've only added support for SQL script migrations - looking forward to adding more!

  8. jpinkster commented on Sep 30, 2019

    @jpinkster

    @ryd0rz Can you open this repo up to the public so we can contribute and report issues specific to this mssql driver? Others in the community would love to help contribute to this.

    Also, it would be helpful to have you and @christiaanwesterbeek collaborate as it feels like he has built the full version of this driver (SQL and Object based). The main issue as you notice in this thread is that we have a terrible work around in order to connect the driver to the base db-migrate library.

    Thanks everyone!

  9. christiaanwesterbeek commented on Oct 1, 2019

    @christiaanwesterbeek

    @ryd0rz You mean your repo for db-migrate-mssql is not public? Why would you close source that one? You're missing out on contributions by the community.

    Let's work together on a single mssql driver for db-migrate that all of us can contribute to.

  10. wzrdtales commented on Oct 1, 2019

    @wzrdtales
    Member

    Agreeing, there is no reason to close something that contributes to open source and giving back to the community.

  11. ryd0rz commented on Oct 1, 2019

    @ryd0rz

    Hey everyone, the repo is actually public...

    Here's the repo:

    https://github.com/ryd0rz/db-migrate-mssql

    We can work on merging any PR and I can even add you @christiaanwesterbeek as a collaborator if you'd like.

  12. jpinkster commented on Oct 2, 2019

    @jpinkster

    Hey @ryd0rz, so I reviewed your github repo and there are just a lot of issues with your approach here. No tests, no readme, missing half of the functionality, committed node_modules to git, missing basic information in your package.json that connects npm to your repo, etc.

    If you review everything that @christiaanwesterbeek published, you will see this supports all the key features that the rest of the drivers have. Honestly, it would be best for this community for you to transfer ownership of this npm package to @christiaanwesterbeek so everyone can utilize his version that aligns with what is supported.

    See link to understand how to transfer ownership: https://docs.npmjs.com/transferring-a-package-from-a-user-account-to-another-user-account

    PS. I mean this all in the most respectful way. Love everything you started and that you are in the community! It is great to see you putting yourself out there and contributing. Stay encouraged

  13. christiaanwesterbeek commented on Oct 2, 2019

    @christiaanwesterbeek

    Actually I don't need ownership of his repo. I just need to be able to publish to db-migrate-mssql on npm. I'm not sure if it works like this, but if @ryd0rz would unpublish his db-migrate-mssql on npm, then I can publish what's on https://github.com/devotis/db-migrate-mssql to db-migrate-mssql on npm.

    I guess it's either this (option 1) or a feature (option 2) that I mentioned here #593 (comment) that would allow node-db-migrate to be configured with not just driver="mssql", but also repository="@devotis/db-migrate-mssql".

    So I see two ways to handle this. Option 1 seems to me the path of least technical friction and best for new user adoption (that like to configure as little as possible to get it working)

  14. jpinkster commented on Oct 2, 2019

    @jpinkster

    @christiaanwesterbeek Yes option 1 is your best bet! If you follow that link it shows that they would actually transfer ownership of that npm package namespace so you can republish your version overtop of what is publish now. (Irrelevant of the repo). I tried to see if they could just unpublish but I think you can only unpublished a version, not the whole package.

  15. ryd0rz commented on Oct 3, 2019

    @ryd0rz

    @jpinkster I will clean up my repo in attempt to make it worthy.

    We're currently using this in production for several projects so it makes it a bit more complicated than transferring ownership.

  16. jpinkster commented on Oct 4, 2019

    @jpinkster

    @ryd0rz I see what you are saying but there will be no difference between these two scenarios.

    1. Transfer ownership, the next published version would be 2.0.0 and your production apps (assuming your package.json is setup correctly) will remain on 1.0.0 until you choose to upgrade to 2.0.0 with full support
    2. Go through an overhaul of your repo (or merge all of @christiaanwesterbeek's code in since it's all there), publish next version as 2.0.0 and your production apps will still remain on 1.0.0

    You're advantage is that you remain in control of the opensource repo. In the meantime I guess I can create PR's to get your repo fixed up

  17. ryd0rz commented on Oct 8, 2019

    @ryd0rz

    @jpinkster - your changes are merged and published. Apologies for the delay.

    db-migrate-mssql@2.0.0

  18. jessephelps commented on Mar 2, 2022

    @jessephelps

    Any updates on this?

  19. ryd0rz commented on Mar 2, 2022

    @ryd0rz

    Good Afternoon Jesse,

    The changes were merged as of Oct 8, 2019 and published as db-migrate-mssql@2.0.0

    Can I help you with something else?

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