@blitznocode/blitz-orm 0.0.39 → 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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/readme.md +40 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blitznocode/blitz-orm",
3
- "version": "0.0.39",
3
+ "version": "0.0.41",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {
package/readme.md CHANGED
@@ -2,11 +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
- ## Definitions
6
- ### Client
7
- The client is usually a frontend app that will send BQL requests (queries or mutations) to the API
8
- ### Server
9
- The server is usually and endpoint that receives a BQL object
10
-
11
- ## How does it work
12
- The client can get
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
+
8
+ ## How to use
9
+ - Install the package with your packages manager, like this:
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
+ ```
32
+
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.
36
+
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
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
42
+
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.