Skip to content

Commit 5b54de8

Browse files
committed
Initialized project
1 parent 0d8c1e3 commit 5b54de8

File tree

4 files changed

+532
-0
lines changed

4 files changed

+532
-0
lines changed

README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# db-to-graphql
2+
3+
A graphql schema generator that uses the schema(s) of a database to generate a graphql schema.
4+
5+
### Currently supported databases
6+
7+
* Oracle
8+
9+
### Current implementation of the graphql spec
10+
* Oracle
11+
* Read only
12+
* AND filtering
13+
14+
## Getting Started
15+
A database and database user must already be created. What tables and database schema(s) are made available to graphQL depends on the select permissions of the used database user. For further refinement, one or more database schemas can be specified as an optional parameter.
16+
17+
### Using db-to-graphql
18+
19+
Install db-to-graphql
20+
21+
using npm:
22+
23+
```sh
24+
npm install --save db-to-graphql
25+
```
26+
27+
Using this package:
28+
29+
```js
30+
var dbToGraphql = require('db-to-graphql');
31+
32+
const DB_CONNECTION = {
33+
user: 'user',
34+
password: 'pass',
35+
connectionString: 'hostname:port/sid'
36+
};
37+
38+
dbToGraphql.generateGraphQL(DB_CONNECTION, 'Oracle')
39+
.then(function(generatedGraphql) {
40+
let {root, schema} = generatedGraphql;
41+
})
42+
.catch((err) => {
43+
console.log(err);
44+
});
45+
```
46+
47+
If you want to restrict which schemas are used for graphql and don't want to modify the permissions for the database user:
48+
```js
49+
dbToGraphql.generateGraphQL(DB_CONNECTION, 'Oracle', ['SCHEMA1', 'SCHEMA2'])
50+
```
51+
52+
### Dependencies
53+
* [Oracle thin client](https://oracle.github.io/odpi/doc/installation.html)
54+
* Required for the [oracledb](https://github.com/oracle/node-oracledb/blob/master/INSTALL.md) package.
55+
56+
### Contributing
57+
58+
I encourage contribution especially with supporting more databases.
59+
60+
### Changelog
61+
62+
Changes are tracked as [GitHub releases](https://github.com/NathanLapp/db-to-graphql/releases).
63+
64+
### License
65+
66+
db-to-graphql is [MIT-licensed](https://github.com/NathanLapp/db-to-graphql/blob/master/LICENSE).

0 commit comments

Comments
 (0)