Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gamote/cifru
Cypher queries with no strings attached! ๐
https://github.com/gamote/cifru
cypher cypher-query cypher-query-language graph-database neo4j orm query-builder redis-graph typescript
Last synced: about 1 month ago
JSON representation
Cypher queries with no strings attached! ๐
- Host: GitHub
- URL: https://github.com/gamote/cifru
- Owner: Gamote
- Created: 2023-08-23T14:06:44.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-08T14:56:17.000Z (6 months ago)
- Last Synced: 2024-10-10T09:21:29.202Z (about 1 month ago)
- Topics: cypher, cypher-query, cypher-query-language, graph-database, neo4j, orm, query-builder, redis-graph, typescript
- Language: TypeScript
- Homepage:
- Size: 228 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Roadmap: ROADMAP.md
Awesome Lists containing this project
README
# cifru
[![NPM version](https://img.shields.io/npm/v/cifru.svg?style=flat)](https://www.npmjs.com/package/cifru)
[![NPM downloads](https://img.shields.io/npm/dm/cifru.svg?style=flat)](https://www.npmjs.com/package/cifru)**Cifru** (๐ฃ `[หtอกสifru]`): cypher queries with no strings attached! Dive into our lightweight ORM that makes writing production-ready queries feel like a breeze.
- **String validation at compile time**: uses TypeScript template literals to validate node and relation names, ensuring correct format before runtime.
## Installation
```bash
yarn add cifru
```## Usage
```ts
import c, { Direction } from 'cifru';const query = c
.match(
c
.node({
variable: 'a',
labels: ['Actor'],
properties: { name: 'Cami' },
})
.relation({
direction: Direction.Outgoing,
variable: 'r',
labels: ['ACTED_IN'],
properties: { roles: ['Trinity'] },
})
.node({
variable: 'm',
labels: ['Movie'],
properties: { name: 'The Matrix' },
}),
)
.return('a')
.query();console.log(query);
// => MATCH (a:Actor {name: 'Cami'})-[r:ACTED_IN {roles: 'Trinity'}]->(m:Movie {name: 'The Matrix'})
// RETURN a
```## Testing
```bash
yarn test
```