Socket
Socket
Sign inDemoInstall

orma

Package Overview
Dependencies
Maintainers
2
Versions
233
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

orma - npm Package Compare versions

Comparing version 1.0.7 to 1.0.19

build/helpers/error_handling.d.ts

36

package.json
{
"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
build/index.d.ts
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc