taviroquai / db2graphql

Generate a Graphql schema and resolvers from an existing relational database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MsSql

kivervinicius opened this issue · comments

Plan to support MSSQL?

Hi!

I think it is pretty possible to support MSSQL.

I will try to find some time to develop this.

It will go into adapters

Thank you so much.

Can I try to assist this process, basically if I take an adapter of this example and convert it to MSSQL functions would it solve?

Yes its should be no problem. Let me know if you need Help. Thank you!

Hi @kivervinicius ,

I took some time to work on this feature. It is now available since commit fb558cb !

It is also available on NPM using npm install db2graphql@0.8.1

I have used a local MS SQL Server (Express) instance to test it. All tests passed but unfortunately Travis CI does not support MsSql service to test it upstream.

I had hard time to configure access to MS SQL database (side note).
This config should work:

{
  "client": "mssql",
  "debug": true,
  "connection": {
    "host": "localhost",
    "database": "db2graphql",
    "user": "db2graphql",
    "password": "",
    "trustServerCertificate": true,
    "dialectOptions": {
      "instanceName": "SQLEXPRESS"
    }
  },
  "exclude": []
}

Also, these are the dependencies that you need to use with this library.

{
  "apollo-server": "^3.10.0",
  "db2graphql": "^0.8.1",
  "graphql": "^16.5.0",
  "knex": "^2.2.0",
  "tedious": "^15.0.0"
}

Some dependencies require node version >= 14.

Let me know if you can test it and give some feedback.

BTW: you will have to specify the schema name, please see:
https://github.com/taviroquai/db2graphql/blob/master/demo_mssql/index.js#L10

Kind regards

Olá amigo, não consigo testar agora, mas em breve farei, por enquanto havia saído do meu escopo essa lib, porém ela continua muito interessante, parabéns pelo progresso.

@taviroquai