db2graphql
Advanced tools
Comparing version 0.7.0 to 0.8.1
{ | ||
"name": "db2graphql", | ||
"version": "0.7.0", | ||
"version": "0.8.1", | ||
"description": "Generate Graphql schema based on existing relational database", | ||
@@ -10,6 +10,8 @@ "main": "index.js", | ||
"scripts": { | ||
"demo-pg": "sudo psql -h localhost -U postgres -f ./demo/database.sql db2graphql", | ||
"demo-mysql": "sudo mysql --user=root --password db2graphql < ./demo_mysql/database.sql", | ||
"demo-pg": "psql -h localhost -U postgres -f ./demo/database.sql db2graphql", | ||
"demo-mysql": "mysql --user=root --password db2graphql < ./demo_mysql/database.sql", | ||
"demo-mssql": "sqlcmd -S localhost\\SQLEXPRESS -i ./demo_mssql/database.sql", | ||
"start": "nodemon demo", | ||
"start-mysql": "nodemon demo_mysql", | ||
"start-mssql": "nodemon demo_mssql", | ||
"docs:update": "jsdoc src --debug -d docs -R README.md -t docstemplates/default", | ||
@@ -40,5 +42,7 @@ "test": "jest --maxWorkers=1", | ||
"knex": "^0.21.7", | ||
"mssql": "^8.1.2", | ||
"mysql": "^2.18.1", | ||
"nodemon": "^2.0.6", | ||
"pg": "^8.4.1" | ||
"pg": "^8.4.1", | ||
"tedious": "^14" | ||
}, | ||
@@ -45,0 +49,0 @@ "jest": { |
@@ -12,3 +12,3 @@ <p align="center"> | ||
[![NPM Version Badge](https://img.shields.io/npm/v/db2graphql.svg)](https://www.npmjs.com/package/db2graphql) | ||
[![Build Status Badge](https://travis-ci.org/taviroquai/db2graphql.svg?branch=master)](https://travis-ci.org/taviroquai/db2graphql) | ||
[![Build Status Badge](https://api.travis-ci.com/taviroquai/db2graphql.svg?branch=master)](https://app.travis-ci.com/github/taviroquai/db2graphql) | ||
[![Coverage Status Badge](https://coveralls.io/repos/github/taviroquai/db2graphql/badge.svg?branch=master)](https://coveralls.io/github/taviroquai/db2graphql?branch=master) | ||
@@ -21,3 +21,3 @@ ![Dependencies Badge](https://img.shields.io/david/taviroquai/db2graphql.svg?style=flat) | ||
* Fully compatible with **express**, **koa**, **hapi** and **Apollo Server** | ||
* Converts an existing relational database (only PostgreSQL and MySQL for now) schema to a JSON schema | ||
* Converts an existing relational database (only PostgreSQL, MySQL and MSSql for now) schema to a JSON schema | ||
* Generates a Graphql SDL schema with convenient types, queries and mutations | ||
@@ -60,3 +60,3 @@ * Implements a generic Graphql resolver ready for API prototyping | ||
## Limitations/TODO | ||
* Only PostgreSQL and MySQL supported | ||
* Only PostgreSQL, MySQLand MSSql supported | ||
* Better database types handling | ||
@@ -63,0 +63,0 @@ * Better database queries optimization |
@@ -159,3 +159,3 @@ const hash = require('string-hash-64'); | ||
let query = this.db(fullname); | ||
query.returning(pk) | ||
query.returning(pk); | ||
result = await query.insert(data.input); | ||
@@ -162,0 +162,0 @@ if (data._debug) console.log('db insert:', query.toSQL().sql, query.toSQL().bindings); |
const PostgreSQL = require('../src/adapters/postgres'); | ||
const Mysql = require('../src/adapters/mysql'); | ||
const MSSql = require('../src/adapters/mssql'); | ||
const Compiler = require('../src/graphql/compiler'); | ||
@@ -35,3 +36,4 @@ const Resolver = require('../src/graphql/resolver'); | ||
pg: PostgreSQL, | ||
mysql: Mysql | ||
mysql: Mysql, | ||
mssql: MSSql | ||
} | ||
@@ -38,0 +40,0 @@ this.connection = db; |
1535402
88
5861
12