@blitznocode/blitz-orm 0.0.40 → 0.0.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/readme.md +33 -4
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -2,14 +2,43 @@ Blitz-orm is a public package that can be open-sourced
|
|
|
2
2
|
|
|
3
3
|
Similar to Prisma, it's used to interpret a BQL schema and provide the client and the server with tools to ensure they are "speaking the same language"
|
|
4
4
|
|
|
5
|
+
## Compatibility
|
|
6
|
+
The only database that is currently compatible with borm is TypeDB. We want to build adapters in the future for other graph databases like dgraph and neo4j, as well as classic dbs like postgres and mongoDB.
|
|
7
|
+
|
|
5
8
|
## How to use
|
|
6
9
|
- Install the package with your packages manager, like this:
|
|
7
10
|
`yarn add @blitznocode/blitz-orm`
|
|
11
|
+
- Create a borm schema, ou have an example in the test folder
|
|
12
|
+
- borm.define() is still not working, this means you will need to translate your bql schema into a typeQL schema manually (an example in test folder)
|
|
13
|
+
- Create a configuration file with the database name that you have created in typeDB
|
|
14
|
+
- Init borm in a file like this
|
|
15
|
+
```
|
|
16
|
+
import BormClient from '@blitznocode/blitz-orm';
|
|
17
|
+
|
|
18
|
+
import { bormConfig } from './borm.config';
|
|
19
|
+
import { schema } from './schema';
|
|
20
|
+
|
|
21
|
+
const bormClient = new BormClient({
|
|
22
|
+
schema,
|
|
23
|
+
config: bormConfig,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export default bormClient;
|
|
27
|
+
```
|
|
28
|
+
- And now you can run queries and mutations like this
|
|
29
|
+
```
|
|
30
|
+
const res = await bormClient.mutate({$entity: 'User', name: 'Ann'} { noMetadata: true });
|
|
31
|
+
```
|
|
8
32
|
|
|
9
|
-
|
|
33
|
+
## How to run typeDB locally
|
|
34
|
+
Follow official instructions: https://docs.vaticle.com/docs/running-typedb/install-and-run
|
|
35
|
+
We advice to run TypeDB studio, define the schema there and do some tests with pure typeQL before using borm.
|
|
10
36
|
|
|
11
|
-
##
|
|
37
|
+
## Collaborate / Contact
|
|
38
|
+
You can help us adding adapters (mongo, postgres, neo4j...), a BQL<>graphQL mapper, performance enhancements, or contributing with our public roadmap for this package (not yet published). Please feel free to send an email to loic@blitnocode.com
|
|
12
39
|
|
|
40
|
+
## Warning
|
|
41
|
+
- This package is in alpha version, not yet ready for production. Most key queries and mutations do work, but a lot is missing and performance has to be enhanced also in the future. One of the biggest performance drops is on nested queries as they currently require as many calls to typeDB as levels of depth
|
|
13
42
|
|
|
14
|
-
##
|
|
15
|
-
|
|
43
|
+
## Working
|
|
44
|
+
- To check what is working and some examples, please feel free to check the test folder, where there are a bunch of queries and mutations.
|