Comparing version 1.0.7 to 1.0.19
{ | ||
"name": "orma", | ||
"version": "1.0.7", | ||
"version": "1.0.19", | ||
"description": "A declarative relational syncronous orm", | ||
@@ -8,3 +8,5 @@ "main": "build/index.js", | ||
"build": "tsc", | ||
"deploy": "node -e \"require('./.github/deploy.js').deploy()\"" | ||
"deploy": "node -e \"require('./.github/deploy.js').deploy()\"", | ||
"test": "mocha --package package.json", | ||
"nt": "nodemon --exec npm run test" | ||
}, | ||
@@ -43,4 +45,32 @@ "files": [ | ||
"devDependencies": { | ||
"@jsdevtools/npm-publish": "^1.4.3" | ||
"@jsdevtools/npm-publish": "^1.4.3", | ||
"@types/chai": "^4.2.19", | ||
"@types/node": "^16.3.2", | ||
"chai": "^4.3.4", | ||
"mocha": "^9.0.1", | ||
"sql-formatter": "^4.0.2", | ||
"sucrase": "^3.19.0", | ||
"tsc": "^2.0.3", | ||
"typescript": "^4.3.5" | ||
}, | ||
"mocha": { | ||
"require": [ | ||
"sucrase/register/ts" | ||
], | ||
"spec": "src/**/*.test.ts", | ||
"timeout": 0 | ||
}, | ||
"nodemonConfig": { | ||
"verbose": true, | ||
"legacyWatch": true, | ||
"ignore": [ | ||
"node_modules", | ||
"build" | ||
], | ||
"watch": [ | ||
"./" | ||
], | ||
"exec": "npm test", | ||
"ext": "ts, js, jsx" | ||
} | ||
} |
## Orma | ||
Update read format, | ||
----------🚧 THIS PROJECT IS A WORK IN PROGRESS 🚧---------- | ||
Orma is a declarative ORM. | ||
The goal is to provide a high level syntax with low performance overhead. | ||
Orma is a declarative, syncronous, dependency free ORM. | ||
Orma provides introspection, validation, query construction and mutations. The package accepts json objects and returns sql strings. | ||
Orma provides introspection, validation, query construction and mutations. | ||
The package uses json format to represent sql queries and mutations. | ||
When the database is instrospected a declarative schema is generated as a json object. | ||
Typescript types are also generated. | ||
The orma schema can be diffed by the user and validated using runtime schema validation functions. | ||
To construct orma queries, pass a json object with columns to include or subqueries similar to graphql. Reserved sql keywords can be accessed with the $ prefix and snake case. (eg $group_by, $limit, $where) | ||
To construct orma mutations, pass a json object with nested objects and the schema. Orma | ||
will use a single pass toposort algorithm to decompose into the minimum number of batch | ||
insert requests and run them in parallel ensuring parents get created before children, | ||
and foreign key references are inserted into children tables. | ||
Key Advantages | ||
Disadvantages | ||
Supports sql databases only | ||
## Installation | ||
@@ -36,1 +57,29 @@ ``` | ||
``` | ||
## Examples | ||
```js | ||
// How to run a long lived transaction | ||
``` | ||
```js | ||
// How to batch insert nested tables | ||
``` | ||
```js | ||
// How to query for table1 where table2 matches a criteria | ||
``` | ||
```js | ||
// How to query all table1 including table2 when table2 matches a criteria | ||
``` | ||
```js | ||
// How to use any/all for hierarcy queries eg permissions | ||
``` | ||
```js | ||
// How to use $op cascading | ||
``` | ||
# Power user examples |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Debug access
Supply chain riskUses debug, reflection and dynamic code execution features.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
237012
62
5600
85
9
2
1